- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- <h1>pop()</h1>
- <h2>ar=["1st","2nd","3rd","4th"]</h2>
- <input type="button" onclick="ar_pop();" value="pop() in array">
- <script>
- function ar_pop()
- {
- var ar = ["1st", "2nd", "3rd", "4th"];
- //Method 1
- alert("Returne : " + ar.pop()); //remove the and return the last value '4th'
- alert("After : " + ar);
- }
- </script>
- </body>
- </html>
The pop in JavaScript :- Geniusofstudent
Reviewed by Network security
on
July 11, 2019
Rating:

No comments: