-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path3.html
More file actions
35 lines (32 loc) · 740 Bytes
/
Copy path3.html
File metadata and controls
35 lines (32 loc) · 740 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Array3</title>
</head>
<body>
<script>
var arr=[];
for(var i=0; i<=10; i++){
arr[i]=Math.round(Math.random()*10);
document.write(arr[i]+" ");
}
var str=arr.join(" ");
document.write("<br>"+str+"<br>");
delete arr[0];
for(var key in arr){
document.write(arr[key]+" ");
}
arr.splice(8, 2, "New", "newOne", "newTwo");
document.write("<br>");
for(var k in arr){
document.write(arr[k]+" ");
}
document.write("<br>");
var newArray=arr.concat("Two", "Tree", "Four", "Five");
for(var j in newArray){
document.write(newArray[j]+" ");
}
</script>
</body>
</html>