-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patharray.html
More file actions
50 lines (46 loc) · 1.37 KB
/
array.html
File metadata and controls
50 lines (46 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<script type="text/javascript">
var arr = ["Jerry", "Tom", "Candy", "Thomas"];
arr.pop();
console.log(arr);
//Array[4] 0: "Jerry" 1: "Nick" 2: "Tom" 3: "lilei" length: 4__proto__: Array[0] array.html:15
console.log(arr.pop());
//Candy
//undefined
console.log(arr);
//["Jerry", "Tom"] VM90:2
//undefined
console.log(arr.join());
//Jerry,Tom VM97:2
//undefined
arr.push("Nick")
//3
console.log(arr);
//["Jerry", "Tom", "Nick"] VM120:2
//undefined
arr.push("lilei","hanmeimei")
//5
console.log(arr);
//["Jerry", "Tom", "Nick", "lilei", "hanmeimei"] VM122:2
//undefined
arr.reverse()
//["hanmeimei", "lilei", "Nick", "Tom", "Jerry"]
arr.shift()
//"hanmeimei"
console.log(arr);
//["lilei", "Nick", "Tom", "Jerry"] VM205:2
//undefined
arr.sort()
//["Jerry", "Nick", "Tom", "lilei"]
</script>
</body>
</html>