-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththree.js
More file actions
38 lines (28 loc) · 713 Bytes
/
Copy paththree.js
File metadata and controls
38 lines (28 loc) · 713 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
// for of loop
// ["", "", ""]
// [{},{},{}]
const arr = [1, 2, 3, 4, 5];
for (const num of arr) {
// console.log(num);
}
const greetings = "Hello world!"
for (const greet of greetings) {
// console.log(`Each char is ${greet}`);
}
// Maps
const map = new Map()
map.set('IN', "India");
map.set('USA', "United State of America")
map.set('Fr', "France")
map.set('IN', "India");
// console.log(map);
for (const [key,value] of map) {
// console.log(key, ':-', value);
}
const myObject = {
game1: 'NFS',
game2 : 'spiderman'
}
// for (const [key, value] of myObject) {
// console.log(key, ';-', value);
// }