JavaScript For Loop

JavaScript For Loop


JavaScript For Loop
The for loop is used to execute a statement or set of statements repeatedly for a specific numbers of times.
The Syntax of for Loop is as follows:
For (initialization: test condition; iteration statement
{
Statement(s) to be executed if test condition is true
}
Flowchart of for Loop
https://sp-ao.shortpixel.ai/client/to_auto,q_glossy,ret_img,w_869,h_1024/https:/www.futurefundamentals.com/wp-content/uploads/2022/01/for-loop-869x1024.png
Example1 - JavaScript program to print numbers from 1 to 10 using for loop:
 
Output