-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp438.js
More file actions
65 lines (50 loc) · 931 Bytes
/
app438.js
File metadata and controls
65 lines (50 loc) · 931 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
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
61
62
63
64
65
var arr = [
1,
false,
{
name: 'Tony',
address: 'USA'
},
function(name) {
var greeting = 'Hello ';
console.log(greeting + name);
}
];
console.log(arr);
arr[3](arr[2].name);
//by value (primitives)
console.log(this);
var a = 3;
var b;
b = a;
a = 2;
//alert (b);
//alert(a);
//by reference (all objects (including functions))
var c = { greeting: 'Hi' };
var d;
d = c;
c.greeting = 'Hello';
console.log(c.greeting);
console.log(d.greeting);
/*var employee = {
firstname: 'Ayyappa',
lastname: 'Pindi',
address: {
street: '4th cross, 4th main',
area: 'Banashankari'
}
};
console.log(employee);
function retrieve(data){
console.log (data.firstname);
console.log (data.lastname);
console.log (data.address.area);
}
retrieve(employee);
retrieve({
firstname: "Anitha",
lastname: "Pindi",
address: "asdasd"
});
*/