JavaScript code to display number from 1 to 5 :
var n=1;// declared the variable and initialized it
for( n=1; n<=5; n++){
console.log(n);
}
Output:
1
2
3
4
5
Note: Output will show in console by inspecting browser
JavaScript code to display number from 1 to 5 :
Output:
1
2
3
4
5
Note: Output will show in console by inspecting browser
Comments
Post a Comment