print("'5' - 3 = " + ('5' - 3)); print("'5' + 3 = " + ('5' + 3)); print("'5' + '4' = " + ('5' + '4')); print("'5' - '4' = " + ('5' - '4')); print("'5' + + 5 = " + ('5' + + 5)); print("'5' + + '5' = " + ('5' + + '5')); print("'foo' + + 'foo' = " + ('foo' + + 'foo')); print("'5' + - '2' = " + ('5' + - '2')); print("'5' + - + - '2' = " + ('5' + - + - '2')); print("'5' + - + - - '-2' = " + ('5' + - + - - '-2')); var x = 3; print("'5' + x - x = " + ('5' + x - x)); print("'5' - x + x = " + ('5' - x + x)); // More, from the "Wat" presentation at CodeMash 2012 print("[] + [] = " + ([] + [])); print("[] + {} = " + ([] + {})); print("{} + [] = " + ({} + [])); print("{} + {} = " + ({} + {})); print("Array(16) = " + (Array(16))); print("Array(16).join(\"wat\") = " + (Array(16).join("wat"))); print("Array(16).join(\"wat\" + 1) = " + (Array(16).join("wat" + 1))); print("Array(16).join(\"wat\" - 1) + \" Batman!\" = " + (Array(16).join("wat" - 1) + " Batman!"));
Standard input is empty
'5' - 3 = 2
'5' + 3 = 53
'5' + '4' = 54
'5' - '4' = 1
'5' + + 5 = 55
'5' + + '5' = 55
'foo' + + 'foo' = fooNaN
'5' + - '2' = 5-2
'5' + - + - '2' = 52
'5' + - + - - '-2' = 52
'5' + x - x = 50
'5' - x + x = 5
[] + [] =
[] + {} = [object Object]
{} + [] = [object Object]
{} + {} = [object Object][object Object]
Array(16) = ,,,,,,,,,,,,,,,
Array(16).join("wat") = watwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Array(16).join("wat" + 1) = wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1
Array(16).join("wat" - 1) + " Batman!" = NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!