So i've been looking into type coercion and i get the basics, like how:
true + 0 = 1;
false + 0 = 0;
while messing around in the console I noticed that
({}) + true = "[Object Object]true";
{} + true = 1;
my question being why does {}
get changed to [Object Object]
when in ()
and not when just added to true
without the ()
?