这个 JavaScript 结构是什么:" = [y 对于每个...]”

发布于 2024-08-21 19:32:48 字数 169 浏览 3 评论 0 原文

myColl.y = [y for each (y in myColl.y) if (y != myThing.getY())];

我明白这是在做什么,返回所有不是当前项的“y”项...

但是,这里用括号调用的概念是什么? 我想了解一下这是什么、语法等等。

myColl.y = [y for each (y in myColl.y) if (y != myThing.getY())];

I understand what this is doing, returning all the 'y' items that are not the current one...

But, what is the concept called here with the brackets?
I would like to read up on what this is , syntax, etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘和柠 2024-08-28 19:32:48

这是一个数组理解。

显然这是在 Javascript 1.7 中引入的。

It's an array comprehension.

Apparently this was introduced in Javascript 1.7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文