Editor Arrow Download Open
<html> <head> <title>JavaScript Array shift() function</title> </head> <body> <script type="text/javascript"> var city = ["Tokyo", "Mumbai", "Delhi", "Las Vegas"]; document.write("Amazing Cities: " + city.join(", ") + "<br />"); document.write(city.shift() + "<br />"); document.write(city + "<br />"); document.write(city.shift() + "<br />"); document.write(city + "<br />"); document.write(city.shift() + "<br />"); document.write(city); </script> </body> </html>
  Preview Arrow