Skip to content

Commit efa52aa

Browse files
committed
Solve & Practicing
1 parent 20adaed commit efa52aa

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Chapter 5/21_PracticeSet.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Chapter 5 Practice Set
2+
// Practice Problem 1P
3+
4+
// Practice Problem 2
5+
// let arr = [1, 2, 3, 4, 5, 6, 7, 83]
6+
// let a;
7+
// do {
8+
// a = prompt("Enter a number")
9+
// a = Number.parseInt(a)
10+
// arr.push(a)
11+
// } while (a != 0);
12+
// console.log(arr)
13+
14+
// Practice Problem 3
15+
// let arr = [1, 2, 30, 4, 50, 6, 7, 83, 670]
16+
// let n = arr.filter((x)=>{
17+
// return x%10 == 0
18+
// })
19+
// console.log(n)
20+
21+
// Practice Problem 4
22+
// let arr = [1, 2, 30, 4, 50, 6, 7, 83, 670]
23+
// let n = arr.map((x)=>{
24+
// return x*x
25+
// })
26+
// console.log(n)
27+
28+
// Practice Problem 5
29+
let arr = [1, 2, 3, 4, 5]
30+
let n = arr.reduce((x1, x2) => {
31+
return x1 * x2
32+
})
33+
console.log(n)

0 commit comments

Comments
 (0)