View Single Post
  #7 (permalink)  
Old 09-17-09, 11:04 AM
carters-site's Avatar
carters-site carters-site is offline
Wannabe Coder
 
Join Date: Sep 2009
Location: Moline, IL
Posts: 100
Thanks: 2
Thanked 1 Time in 1 Post
Quote:
Originally Posted by End User View Post
Yep, Javascript is the only language I know where "2 + 2" equals "22".

C, C++, perl, PHP, java, Forth, BASIC, COBOL, LISP, etc etc....all those will give you "4". But not Javascript, noooooo. That'd be too easy.

I don't know what they were smoking when they decided on string concatenation as the default behavior for "+", but it must have been some really, really strong stuff.
LOL! Yes one of the many annoyances of javascript. The other is debugging in IE... / wrist
Reply With Quote