-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
63 lines (39 loc) · 980 Bytes
/
index.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
61
62
63
//import {additionArrow, sayHi} from "./fundamentals.js";
//sayHi("Sachin")
//console.log(additionArrow(5, 66))
//let objOne = new Object()
/*objOne = {
name: "Sachin",
location: "Mumbai",
"hello world": "Yes, Whatsup"
}
console.log(objOne)
console.log(objOne.name)
console.log(objOne.location)
//delete objOne.location
//console.log(objOne["hello world"])*/
//Property value shorthand
/*function displayUser(name, age, location){
return {
let : name,
for: age,
while: location,
}
}
let user = displayUser("Sachin", 55, "Mumbai")
console.log(user.for)*
let user = { name: "John", age: 30 };
*/
//Property exist using ..in
let user = { name: "John", age: 30 , location: 'Chennai'};
/*console.log("age" in user)
console.log("location" in user)
if("location" in user){
console.log("It is exist")
}
else {
console.log("It is not exist")
}*/
for (let key in user) {
console.log(key + " >> " + user[key])
}