JS Array Methods


Array toString() Method

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var a = ["Rahul","Karan","Aman","Neha"];
	a.toString();
	document.write(a + "<br><br>");
  </script>
</head>
<body>
</body>
</html>


Array valueOf() Method

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var a = ["Rahul", "Karan", "Aman", "Neha"];
	document.write(a.valueOf() + "<br><br>");
  </script>
</head>
<body>
</body>
</html>


Array fill() Method

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var a = ["Rahul", "Karan", "Aman", "Neha"];
	a.fill("Ram");
	document.write(a);
  </script>
</head>
<body>
</body>
</html>