JS Array Pop & Push


Array Pop()

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var a = ["Sanjay", "Aman", "Rehman", "Karan"];

    document.write(a + "<br><br>");
    a.pop();
    document.write(a);
  </script>
</head>
<body>

</body>
</html>


Array push()

<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var a = ["Sanjay", "Aman", "Rehman"];

    a.push("Rahul");
    document.write(a + "<br><br>");
    a.push("Salman");
    document.write(a + "<br><br>");
  </script>
</head>
<body>
</body>
</html>