MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/30hyan/airbnb_javascript_style_guide_a_mostly_reasonable/cpu393z/?context=3
r/javascript • u/mrkipling • Mar 27 '15
158 comments sorted by
View all comments
Show parent comments
3
new String(foo) is such craziness (all boxing is crazy in Javascript), it makes me uncomfortable to see String(foo)
new String(foo)
String(foo)
2 u/shriek Mar 28 '15 haha. What about toString()? For the most part I've used that instead of ''+foo 3 u/ianb Mar 28 '15 > (null).toString() TypeError: Cannot read property 'toString' of null 1 u/shriek Mar 29 '15 So is undefined, but I see your point. Thanks for pointing that out.
2
haha. What about toString()? For the most part I've used that instead of ''+foo
toString()
''+foo
3 u/ianb Mar 28 '15 > (null).toString() TypeError: Cannot read property 'toString' of null 1 u/shriek Mar 29 '15 So is undefined, but I see your point. Thanks for pointing that out.
> (null).toString() TypeError: Cannot read property 'toString' of null
1 u/shriek Mar 29 '15 So is undefined, but I see your point. Thanks for pointing that out.
1
So is undefined, but I see your point. Thanks for pointing that out.
undefined
3
u/ianb Mar 27 '15
new String(foo)is such craziness (all boxing is crazy in Javascript), it makes me uncomfortable to seeString(foo)