undefined

bokuweb.me

CoffeeScriptで逆順で配列をループする


どうやらこれでいいらしい。

array = [0, 2, 4, 9]
for v, i in array by -1
  console.log "i = " + i + " v = " + v

###
出力
i = 3 v = 9
i = 2 v = 4
i = 1 v = 2
i = 0 v = 0