Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
jestdotty5529303dalso 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 -
C0D466902303dTell 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. -
daniel-wu679303dThere 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. -
AlgoRythm50240303dJavaScript 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
-
ltlian2188303dWe'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. -
Lensflare17445303d@ltlian This attitude is the reason why we are stuck with this crap in the first place!
JS MATH IS NOT MATHING
source : https://aprogrammerlife.com/top-rat...
rant
javascript