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
-
moagggi7817yAlso I prefer
i = "" + i;
so I'm sure, what the resulting datatype is. Consider
i = 5 + c * s + f + a + i + "";
for the "proof". -
@moagggi pretty much as expected. Adding ' ' at start and end won't make any different. Anything did I miss?
-
Foremost, it looks ugly.
Secondly, the purpose of '+' operator is addition/concatenation, not to convert number into string.
Lastly, engine/compiler has to do 2 operations: first convert the number and then concatenate empty string.
Related Rants
-
linuxxx32*client calls in* Me: good morning, how can I help you? Client: my ip is blocked, could you unblock it for m...
-
DRSDavidSoft28Found this in our codebase, apparently one of my co-workers had written this
-
linuxxx23*client calls* "hello, we forgot the password to our WiFi router. Could you reset that for us?" 😐😶😮...
WTF to convert integer to string:
var i = 1;
var str = i + "";
devrant
wtf