-1

I was wondering whether execution of these two has any difference to the JS interpreter. is this because we can not create and call method on object simultaneously.? Any help on this?

Ghan
  • 60
  • 8

1 Answers1

2

Because JavaScript will interpret your curly brace as a block, not an object. Try with:

({}).toString()
Faly
  • 13,291
  • 2
  • 19
  • 37