JS Assignment 5: For Loops
JerehlDyer (4)

What am I doing wrong here?

function exerciseTwo(){
let count = 0;
// In this exercise write your own for loop (you can look at the syntax above).
// It should loop 10 times.
// You are given a variable called: count .
// For each loop reassign count to the current value of count + 1 .
for( let count = 0; count <= 10; count++)
//Please write your answer in the line above.
return count;

You are viewing a single comment. View All
Answered by heyitsmarcus (309) [earned 5 cycles]
View Answer
heyitsmarcus (309)

@Vandesm14 This doesn't work. i is created within the for loop and then doesn't exist outside of the for loop, so you will receive a Reference error in the console when you look at this in the developer console.

My approach is a modern approach, thank you.