$ node -v
v0.12.2
Last active
May 25, 2024 16:51
-
-
Save springheeledjak/64e23a9f5b02b9405c0f to your computer and use it in GitHub Desktop.
Fuck you, JavaScript.
This file contains 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
$ node | |
> null < 1 | |
true | |
> null > -1 | |
true | |
> null < 0 | |
false | |
> null > 0 | |
false | |
> null == 0 | |
false | |
> null + 0 | |
0 |
This file contains 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
$ node | |
> undefined < 1 | |
false | |
> undefined > -1 | |
false | |
> undefined < 0 | |
false | |
> undefined > 0 | |
false | |
> undefined == 0 | |
false | |
> undefined == null | |
true |
This file contains 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
$ node | |
> obj = {}; obj++; obj | |
NaN | |
> obj = {}; obj--; obj | |
NaN | |
> obj = {}; obj += 1 | |
'[object Object]1' | |
> obj = {}; obj -= 1 | |
NaN |
This file contains 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
$ node | |
> arr = []; arr++; arr | |
1 | |
> arr = []; arr--; arr | |
-1 | |
> arr = []; arr += 1 | |
'1' | |
> arr = []; arr -= 1 | |
-1 | |
> arr = []; arr += [] | |
'' |
This file contains 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
$ node | |
> '' == 0 | |
true | |
> str = ''; str += 1 | |
'1' | |
> str = ''; str -= 1 | |
-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fuck You Javascript