JavaScript Example (Program)
Learn Details

Q. Where do use pop() method ?

जिस array के last element को remove (delete) करना हो , तब pop method का use करते हैं

ArrayName.pop()


  • Example

    <script>
    var a = ["Apple", "Ball", "Cat", "Dog"];
     document.write("<b> Before Medhod : </b>"  +a+"</br>");
     a.pop()
     document.write(<b> After Medhod : </b>"  +a);
       
    </script>
    Out Put : Before Medhod : Apple,Ball,Cat,Dog
    After Medhod : Apple,Ball,Cat