javascript - {}.toString() vs ({}.toString())
问题描述
Why below code is working:
({}.toString()) // "[object Object]"
but this not:
{}.toString() //Uncaught SyntaxError: Unexpected token '.'
解决方案
推荐阅读
- python - 如何从套接字消息中正确获取换行符和变音符号
- html - 如何移动我的文本,使其位于我使用过的图像下方
- html - 在打字稿的数组中删除多个相同的数据
- python - 即使指定了“{”,Python logging.Formatter 也使用“%”格式而不是“{”
- java - 如何在android(java)中获取方法名称
- php - Wamp 看不到 php mongodb 扩展
- javascript - 防止视频海报图像在轮播幻灯片上重新加载
- python - 询问用户几分钟,然后告诉他们几小时内是什么
- javascript - 对javascript中的promise感到困惑
- reactjs - 使用 Fetch 'Get' 向后端请求数据(带有此错误消息 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0)