re: What The For Loop? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What if you were asked to do this without a for loop? ;)
 
 

Or better yet ... use some functional programming!

Array(20)
  .fill()
  .map((_, i) => i + 1)
  .filter((num) => num % 2 !== 0)
  .join('\n')
code of conduct - report abuse