Tuesday, May 13, 2014

"WAT" continued

Gary Bernhardt gave an excellent show with his "WAT" presentation. As a follow up, here is another WAT we've found in JS:
> '2' + '1'   // Lets add two strings - we get another string. Reasonable.
"21"
> '2' - '1'   // Subtraction of the above gives us a number! WAT?
1

No comments:

Post a Comment