• LostXOR
    link
    fedilink
    43 months ago

    Slightly simpler, start at 1 and increment by 2 so you don’t have to check whether i is odd.

    for (var i = 1; i < 100; i += 2) {
      console.log(i);
    }
    
    • Jeena
      link
      fedilink
      33 months ago

      Strictly speaking this one does not find the odd numbers, it just prints them.