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

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

Thank you

Steven Parker
Steven Parker
173,784 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.