JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops Refactor Using a Loop

Kim Dallas
Kim Dallas
11,461 Points

it won't work

nothing works.

for (let i = 2; i <= 24; i += 2) {
  console.log( i );
<!DOCTYPE html>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
<script src="script.js"></script>

2 Answers

Steven Parker
Steven Parker
171,314 Points

Your solution is good, but this course's validator apparently doesn't recognize ES6 syntax. Change the "let" to "var" and you'll pass the challenge.