0
Comments
  • 4
    also 3. is wrong

    258 doesn't magically become 2878

    and as for the first step to get to 25 idk because I don't mix up data types and can keep them in my head and for all else do console.log(typeof x) to find out what data types you're dealing with before you start
  • 0
    Tell me you don't know JS math, without telling me you don't know JS Math.

    It's like that new "standard" math, but easier create new numbers.
  • 4
    There was a popular saying: a bad workman blames his tools. JS was created to be lenient with typing, because historically, it was only used for quick scripting on the front end.

    I have coded with JS for a long time, and I have never accidentally mixed string and number in math addition. It is our responsibility not to do this noob mistake, not the language's. If you get these numbers from third party's back end, where you have no control of, you can always perform parseInt first. Or even better, check for null/empty string/etc.
  • 5
    JavaScript math can be confusing to the uninitiated, especially when you use it in fucking dumbass ways like this. But your entire argument validity was removed when you had an AI (erroneously) make it for you. RIP
  • 0
    We're all stuck with js. Trying to convince someone that it's bad won't change anything. Just use ts or jsdoc with checkJs:true, and learn to avoid these pitfalls.

    Also, arrays can have properties.
  • 2
    @ltlian This attitude is the reason why we are stuck with this crap in the first place!
  • 1
    "explicit is better than implicit"
Add Comment