Thursday, August 26, 2021

For Loop in Javascript Basic guideline for new Comers

For Loop in Javascript: Suppose we have to write same line again and again so we write simple copy and paste but this is not idle way to write code its voilate DRY principle in coding so for this we use For loop for the certain condition is true.

// start loop in Javascript

// console.log(`This is Number 1`);
for (let i = 1; i <= 10; i++) {
console.log(`This is number ${i}`);
}

0 comments

Post a Comment