Pagina de inicio
/
Tecnología
/
7. What will the following program display in the console? For(vor 1 -0; 1 <4; 10+) console, log(1); ) A. 0123 B. 01234 C. 123 D. 1234

Problemas

7. What will the following program display in the console?
For(vor 1 -0; 1 <4; 10+)
console, log(1);
)
A. 0123
B. 01234
C. 123
D. 1234

7. What will the following program display in the console? For(vor 1 -0; 1 <4; 10+) console, log(1); ) A. 0123 B. 01234 C. 123 D. 1234

Solución

avatar
Dianamaestro · Tutor durante 5 años
expert verifiedVerificación de expertos
4.4 (326 votos)

Responder

The given program contains a syntax error. The correct syntax for a for loop in JavaScript is:<br /><br />for (initialization; condition; increment) {<br />// code to be executed<br />}<br /><br />In the given program, the initialization and increment statements are incorrect. Therefore, the program will not execute and will display nothing in the console.<br /><br />So, the correct answer is: None of the above.
Haz clic para calificar: