<!DOCTYPE html><html><body><p id="demo">Click the button to remove the firstelement of the array.</p><button onclick="myFunction()">Try it</button><script>var fruits = ["Banana","Orange","Apple","Mango"];function myFunction(){fruits.shift();var x=document.getElementById("demo");x.innerHTML=fruits;}</script></body></html>上面的代码输出如下结果