Using new operator with return of a javascript function returns odd scope

删除回忆录丶 提交于 2019-12-01 18:05:29

new has higher precedence than the invocation parens (). See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence.

It's simply because of operator precedence. new has higher precedence than the function call. Wrapping your function call in parenthesis changes the order of evaluation.

See the precedence table on MDN for more information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!