Last active
February 26, 2019 21:58
-
-
Save rjfranco/6717368 to your computer and use it in GitHub Desktop.
Javascript is Wierd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[] + [] | |
// returns an empty string, '' | |
[] + [0] | |
// returns a string, '0' | |
[0] + [0] | |
// returns a string, '00' | |
[0,0] + [0] | |
// returns a string, '00,0' | |
[] + {} | |
// returns either a string of '[obejct Object]', or [object Object] | |
{} + [] | |
// returns 0 | |
{} + {}; | |
// returns NaN ( Not a number. ) | |
++[[]][+[]]+[+[]]; | |
// Returns string '10' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment