Since braces in this situation are ambiguous and are interpreted as a block statement , and not as an object literal. Sort of
{
num: 1
}
.num
Where is num:interpreted as label .
You can use the grouping operator to force the construct to be interpreted as an expression:
({num: 1}).num
, return ( )