1

Why below code is working:

({}.toString()) // "[object Object]"

but this not:

{}.toString() //Uncaught SyntaxError: Unexpected token '.'
bsekula
  • 914
  • 1
  • 9
  • 25
  • 5
    `{}` in the beginning of the line is interpreted as an empty code block. Then you have `.toString()` which is just not valid code. – VLAZ May 13 '21 at 21:04

0 Answers0