すんごい初歩の話。 基本形は for i in [0..9] console.log "index="+i[]内で範囲を指定します。 for文で配列からデータ取り出すときは for i in [0..hogehoge.length-1] console.log "value="+hogehoge[i]とか //配列からデータ取り出す for i,value of hogehoge console.log valueとかでいいんですが、 index値をつかって計算させたりとかした場合 for [値],[インデックス] in [配列] という書き方が一番シンプルで使えます。 arr = ["a", "b", "c", "d", "e"] for val, i in arr console.log "#{i}: #{val}""hogehoge.length-1" みたいな書き方で配列の個数を指