Remove the first element of the element group through the shift method in JavaScript

From , 3 Years ago, written in JavaScript, viewed 51 times.
URL https://pastebin.vip/view/8bcf57ca
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p id="demo">Click the button to remove the first element of the array.</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. <script>
  10. var fruits = ["Banana", "Orange", "Apple", "Mango"];
  11.  
  12. function myFunction()
  13. {
  14. fruits.shift();
  15. var x=document.getElementById("demo");
  16. x.innerHTML=fruits;
  17. }
  18. </script>
  19.  
  20. </body>
  21. </html>
  22.  
  23.  
  24. //javascript/7866

Reply to "Remove the first element of the element group through the shift method in JavaScript"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website