Javascript examples for Array:shift
Use array.shift() to popup element from array
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww .j av a 2s . c o m*/ var a = []; a.push(function(){ console.log("a"); }); a.push(function(){ console.log("b"); }); a.shift()(); //alerts a a.shift()(); //alerts b } </script> </head> <body> </body> </html>