JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops Create a for Loop

Mark Wisdom Reeves
Mark Wisdom Reeves
Full Stack JavaScript Techdegree Student 1,890 Points

Create a for loop that logs the numbers 4 to 156 to the console. To log a value to the console use the console.log( ) me

for ( var i = 4; i < 160; i += 1 ) { console.log(i); }

script.js
for ( var i = 4; i < 160; i += 1 ) {
  console.log(i);
}

1 Answer

Jamie Reardon
Jamie Reardon
Front End Web Development Techdegree Student 13,046 Points

The challenge wants you to log the numbers up to 156, not 160, change your condition.