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
-
sejbr446y@CrimsonDynamic Inconsistency in JS.
'3' - 1 is intepreted as number - number operation because - is not used as string operator.
On the other hand + is also used to concat strings as in "string1" + "string2" = "string1string2" so seeing that the first value is a string js automatically converts the latter to also be a string so instead 3 + 1 = 4 we get "3" + "1" = "31" same as string1/2 example above. -
@sejbr Thank you for answer.
Though it's weird that it automatically converts it into a string. -
sejbr446y@CrimsonDynamic Just one of many JS quirks. Always reminds me of https://destroyallsoftware.com/talk... @ 1:20
-
leoat121376y@CrimsonDynamic If you are new in programming and already thinks that Javascript is weird you are in the right path. hahaha
-
CodeBane7736y@rEaL-jAsE I dunno whether it's absolutely normal but it's definitely explainable lol.
Related Rants
Cat.js meme
joke/meme
cat
javascript
js