Js Array operation

Source: Internet
Author: User

<! DOCTYPE html>
<title>please Enter your title</title>
<meta charset= "Utf-8" >
<meta name= "Author" content= "Tanzhou College-Teacher Fei" >
<style type= ' text/css ' >
*{margin:0; padding:0;}

</style>
<body>

<script type= "Text/javascript" >
var arr = [1,2,3,4];

Arr.length; Readable and writable
ARR[0]; Readable and writable
Arr.length = 8;
Alert (arr);

var a = Arr.push (1, 2);
var a = Arr.unshift (' Punk ', ' empty Mountain ');

arr = [1,2,3,4,[4,5,6]]

Alert (arr);

Arr.shift ();
Alert (arr);

Arr.splice (6, 0, ' ah ');
Alert (arr);
/*
var arr = [5,6,7,8,2,1,5,6];

Arr.sort (function (x, y) {
return y-x;
});

Alert (arr);
*/

/*
var arr = [n/a];

var a = Arr.concat ([4,5,6]);

alert (a.length);

var a = Arr.join (' | ');

alert (a);
*/

</script>
</body>

Js Array operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.