Python 出身なので、Coffeescript が Python と Perl から借用した多くの機能 (範囲/スライス、内包表記、構造化代入) が気に入っています。enumerate
Python のor zip
( itertools.izip
) 関数を模倣するために、Coffeescript にシンタックス シュガーはありますか?
私があまり気にしないパターンは次のとおりです。
# an enumerate call would be helpful here
i = 0
for x in arr
... use x and i ...
i++
と
# a zip would be useful here
n = Math.min(arr1.length,arr2.length)
for i in 0...n
x = arr1[i]; y = arr2[i]
... use x and y ...