【发布时间】:2011-12-01 03:08:36
【问题描述】:
如何在 Coffeescript 中中断/继续嵌套循环?例如。我有类似的东西:
for cat in categories
for job in jobs
if condition
do(this)
## Iterate to the next cat in the first loop
另外,有没有办法将整个第二个循环包装为第一个循环中另一个函数的条件?例如。
for cat in categories
if conditionTerm == job for job in jobs
do(this)
## Iterate to the next cat in the first loop
do(that) ## Execute upon eliminating all possibilities in the second for loop,
## but don't if the 'if conditionTerm' was met
【问题讨论】:
标签: coffeescript