for-in loop VS in-operator

删除回忆录丶 提交于 2019-12-02 06:31:51

So this brings me to my question: why is the in operator at all present in the for ... in loop?

It isn't. The in token in the for … in loop construct is not an operator, just as much it is not one in the expression

x = {in: 5}.in

It's just one of the tokens that distinguishes a for ( … in … ) from a for (…; …; …) loop. Given that there is no for (…) statement, the role of the in token in a relational expression never collides with this.

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