News for hackers. Stuff that matters.
Re:The Cursed Computer Iceberg Meme by Zarel on Sunday April 11, 2021 @08:23AM (#26769833)
JavaScript can eliminate all repetition thanks to how its || operator works:

    for (let i = 1; i <= 100; i++) {
      console.log(
        (i % 3 == 0 ? "Fizz" : "") + (i % 5 == 0 ? "Buzz" : "")
        || i
      );
    }
Whether or not you consider this more elegant is a matter of taste, though.
Re:The Cursed Computer Iceberg Meme by strogonoff on Sunday April 11, 2021 @08:47AM (#26769975)
While I like to think the opposite, I can see myself using || with an empty string occasionally (at least with TS, where I can be reasonably sure the variable will definitely be a string at runtime). However, concatenating strings with + is a bit implicit to my taste.