-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfor-in_loop.js
More file actions
40 lines (36 loc) · 788 Bytes
/
for-in_loop.js
File metadata and controls
40 lines (36 loc) · 788 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
<<<<<<< HEAD
=======
/*
>>>>>>> 29ec691 (committed)
const person1 = {
name: "Sampad",
age: 28,
'is Scholar': true,
personInf: function() {
return `${this.name} is ${this.age} years old Scholar`
},
research: {
area: "Computational material science",
topic: "Thermoelectricity",
exp: "3 years",
department: "Chemistry",
university: "Visva-Bharati"
},
}
// for in loop
for(let key in person1){
console.log(key)
// console.log(key, person1[key])
}
for(let key in person1.research){
console.log(key)
// console.log(key, person1[key])
}
<<<<<<< HEAD
=======
*/
let arr1 = [1,3,5,7,9];
for(let i in arr1){
console.log(i, arr1[i]);
}
>>>>>>> 29ec691 (committed)