为什么++ [[]] [+ []] + [+ []]返回字符串“ 10”?

本小妞迷上赌 提交于 2020-08-10 19:10:55

问题:

This is valid and returns the string "10" in JavaScript ( more examples here ): 这是有效的,并在JavaScript中返回字符串"10"此处有更多示例 ):

console.log(++[[]][+[]]+[+[]])

Why? 为什么? What is happening here? 这是怎么回事


解决方案:

参考一: https://stackoom.com/question/UDbp/为什么-返回字符串
参考二: https://oldbug.net/q/UDbp/Why-does-return-the-string-10
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!