top of page

For Loop : Task 1

  • Writer: satyanarayan behera
    satyanarayan behera
  • Aug 25, 2022
  • 1 min read

Write a "for" loop that will perform exactly the same repetitive code as this:


console.log(1)

console.log(2)

console.log(3)

console.log(4)

console.log(5)

console.log('Counting completed!')

1

2

3

4

5

Counting completed!

In For loop:

for (var i=1;i<=5;i++){

console.log(i);

}

console.log('Counting completed!');


Recent Posts

See All
Task 2: Using the logical || operator

Imagine you are coding a video game. Currently, you’re about to code some snippets related to the game over condition. You need to code a...

 
 
 

Comments


  • alt.text.label.LinkedIn

©2022 by Satya

bottom of page