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
-
Just because you are not forced to, that doesn't mean you are not allowed to CONVERT YOUR FUCKING VARIABLES, IT'S LIKE 5 LETTERS YOU IDIOT. And if you want to be careful, you can convert when you get the Dom values.
-
@Maciek not sure if I follow you, so for you (and other Devs who see this, hi)
1 + '1' is a simple string combination, it is the same as 'hello ' + 'world' being 'hello world'. So the reason why it is '11' is clear
'11' - '1' is simply just 11 -1 because you can't subtract a sub string by simply subtracting it with the minus operator, so JavaScript converts the string '1' to integer 1
So 11 - 1 is 10
Related Rants
-
Skipp36What devrant taught me: Everyone hates java Everyone hates php Everyone hates spaces Everyone hates tabs Ever...
-
tahnik63So I need to create a nice new web app. Let's look at some cool JS frameworks that I can work with. *5 mins l...
-
ahmedam23What only relying on JavaScript for HTML form input validation looks like
Le JavaScript~
joke/meme
devrant
javascript
maths
js