Created
December 17, 2016 15:14
-
-
Save binki/e42f03eaf59906736ff32f5494e83ad3 to your computer and use it in GitHub Desktop.
null trick with maps?
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
> var x = {} | |
undefined | |
> x['null'] = 2 | |
2 | |
> x['undefined'] = 4 | |
4 | |
> y = {parentId: null,} | |
{ parentId: null } | |
> x[y.parentId] | |
2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment