Skip to content

Commit f420492

Browse files
updated and added solution
1 parent 2498267 commit f420492

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

D. Loop/For/countdown.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
Implement a countdown timer that counts down from 81 to 65.
44
55
*/
6+
7+
// Solution-1
68
for (let i = 81; i >= 65; i--) {
7-
console.log(i);
9+
if (i % 2 === 0 || i % 2 === 1) {
10+
console.log(i);
11+
}
12+
}
13+
14+
15+
// Solution-2
16+
for (let j = 81; j >= 65; j--) {
17+
console.log(j);
818
}

0 commit comments

Comments
 (0)