0

About algorithms Can i have the solution please ?🙏🏼💙

for(var x = 2; x < 9; x++) { Consol.log(x); }

6th Apr 2021, 1:56 AM
Sharog
Sharog - avatar
3 Respuestas
0
It's for loop in javascript Syntex: var x; for(x = start ; x = end ; x += increment){ // your js code } Here in your case starting index is set to 2 and last index is 9-1 = 8 as x < 9 and increment is of +1 So your loop will iterate from 2 to 8 for x and console.log will print all the numbers ie 2,3,4,5,6,7,8
6th Apr 2021, 1:59 AM
Ayush Kumar
Ayush Kumar - avatar
0
var msg = ‘codingdojo’; for(var x = 6; x < msg.length + 4; x++ ) { console.log(x); }
6th Apr 2021, 2:04 AM
Sharog
Sharog - avatar
0
Thank you so much Can you comblet the solution ?
6th Apr 2021, 2:07 AM
Sharog
Sharog - avatar