0
class Foo
list: []
foos = []
for i in [1..2]
foos.push new Foo
foos[0].list.push "a"
foos[1].list.push "a"
console.log foos[0].list
console.log foos[1].list
這段代碼的輸出是:的CoffeeScript我怎麼可以實例屬性
["a", "a"]
["a", "a"]
但我不明白爲什麼輸出不是:
[ 「一」] [「一「]
似乎foos [k] .list是靜態參數!