首页 > 解决方案 > {}.toString() vs ({}.toString())

问题描述

Why below code is working:

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

but this not:

{}.toString() //Uncaught SyntaxError: Unexpected token '.'

标签: javascript

解决方案


推荐阅读