Create and Read your code
while(n <= 3){
if(ages[n] >= 18){
console.log("You're older")
} else{
console.log("You're a minor")
}
n++
}
- Okey let’s begin, my example is about a while loop.
- while, open parenthesis, N smaller equal 3, close parenthesis, open bracket, if, open parenthesis, ages, open square bracket, N, close square bracket, greater equal, eighteen, close parenthesis, open bracket, console dot log, open parenthesis, open double quotes, You’re older, close double quotes, close parenthesis, close bracket, else, open bracket, console dot log, open parenthesis, open double quotes, You’re a minor, close double quotes, close parenthesis, close bracket, n plus plus, close bracket.
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?