-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathtest.js
67 lines (43 loc) · 1.09 KB
/
test.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
// console.log("Hello world");
// let age = 25;
// const x = 30;
// age = 26;
// let studentName = "Faisal ahmed";
// let y;
// // console.log("===========>❤", y)
// let person = {
// firstName: "John",
// lastName: "Doe",
// age: 30
// };
// var numbers = [1, 2, 3, 4, 5];
// let newString = `My Name is ${studentName} and my age is ${age}
// . I love javascript. My data is here ${person.firstName} and something from array is ${numbers[2]}
// `
// console.log(newString);
// // console.log("=======>test", typeof person, typeof y, typeof age, typeof studentName, typeof numbers)
// const arr = [1, 2, 3, 4, 5];
// let sum = 0;
// for (let i = 0; i < arr.length; i++) {
// sum += arr[i];
// if (sum >= 10) {
// break;
// }
// }
// console.log(sum);
// const arr = [1, 2, 3, 4, 5];
// const result = arr.reduce((acc, num) => {
// if (num % 2 === 0) {
// return acc + num;
// }
// return acc;
// }, 0);
// console.log(result);
const obj = {
prop1: {
prop2: {
prop3: 'value'
}
}
};
console.log(obj.prop1.prop2.prop3.length);