DEV Community

Pranish Shrestha
Pranish Shrestha

Posted on

Here are some weird Javascript

written in console :

>typeof NaN
'number'

>9999999999999999
10000000000000000

>0.1 + 0.2 == 0.3
false

>Math.max()
-Infinity
>Math.min()
Infinity

>[]+[]
''

>[]+{}
'[object Object]'

>{}+[]
0

>true + true + true === 3
true

>true- true
0

>(!+[]+[]+![]).length
9

>91-"1"
90

>[]==0
true

Enter fullscreen mode Exit fullscreen mode

Top comments (0)