Prev Demo
Removing First Number Of An Array In Javascript
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Find the odd one out and click the button to remove tha last number of an array.</p> <button onclick="myFunction()">Click</button> <p id="myId"></p> <script> var a = [83, 65, 85, 25, 15]; document.getElementById("myId").innerHTML = a; function myFunction() { a.shift(); document.getElementById("myId").innerHTML = a; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output