-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo_3.js
60 lines (42 loc) · 777 Bytes
/
demo_3.js
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
51
52
53
54
55
56
57
58
59
60
var arr = [10,20,30];
console.log(arr);
console.log("array lenngth -->>",arr.length);
//push the element
arr.push(40);
console.log(arr);
//pop the element
arr.pop(40);
console.log(arr);
var student = {
name:"ravi",
class:7,
all_rounder:true,
arr:["fuck",10]
}
console.log(student);
console.log(student.name);
student.age=20;
student.all_rounder=false;
console.log(student.arr[1]);
var list =[
{
name:"rin",
roll_no:1
},
{
name:"shin",
roll_no:2
}
];
console.log(list);
console.log(list[0]);
console.log(list[0].name);
console.log(list[1].roll_no);
var animal = ["cat","dog","bat"];
animal.forEach(function(i){
console.log(i);
})
function loop(i){
console.log(i);
}
animal.forEach(loop);