【发布时间】:2015-10-02 05:18:54
【问题描述】:
我有一个数组allLayers,我试图在其中访问单击的a 之后的所有对象。如何选择单击的a 之后的每个对象?
allLayers = []
for i in [0...30]
card = new Layer
allLayers.push(card)
for a in allLayers
a.on Events.Click, ->
## how do I get every object that follows "a" in the array??
感谢您的任何想法。
【问题讨论】:
-
值得注意的是,使用带有潜在同步操作的 for 循环有点危险。
标签: javascript arrays coffeescript