W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <body> <script type="text/javascript"> Array.prototype.enqueue = function(vItem) { this.push(vItem); }; Array.prototype.dequeue = function() { return this.shift(); }; var arr = new Array(3) arr[0] = "George" arr[1] = "John" arr[2] = "Thomas" arr.enqueue("Bill"); document.write(arr); document.write("<br />") arr.dequeue(); document.write(arr); </script> </body> </html>