What are the values of []+[], []+{}, {}+[], {}+{}? And How?
This my console log
>{} + {} >NaN >[] + [] >\'\' >{} + [] >0 >[] + {
The + operator concats strings. So it attempts to convert the objects and arrays to strings.
+
{} converts to '[Object object]', and [] converts to ''.
{}
'[Object object]'
[]
''
EDIT: I can't explain why {} + [] is 0 and why ({}) + [] is "[object Object]".
{} + []
0
({}) + []
"[object Object]"