Method push Array object, pop unshift, shift

<! DOCTYPE HTML the PUBLIC "- // the W3C // DTD HTML 4.01 Transitional // EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<title> Array the method object </ title>
</ head>
<body>
<Script>
// 1.Array object stack operation method pop push ----
// var ARR = [1,4,6];
// ARR. Push (. 7);
// arr.push ( 'Hello', 'Star');
// the console.log (ARR);
// var RET = arr.pop ();
// Alert (RET) // Star
/ the method /2.Array object unshift shift ---- stack operations
var of arr1 = [1,4,6];
arr1.unshift (. 7);
the console.log (of arr1); //. 1. 4. 6
var RET = of arr1. Shift ();
Alert (RET). 7 //
</ Script>

</body>
</html>

Guess you like

Origin www.cnblogs.com/startl/p/12238531.html