12. Challenge Task

The code in script.js logs all even numbers (from 2 to 24) to the JavaScript console. There seems to be a lot of redundant code in the file. Rewrite (or refactor) the code using a loop.


/**Notar que el número va de 2 en 2, hasta llegar a 24*/
for (let i = 2; i <= 24; i += 2) { console.log(i);}
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
) instead.