6
這是有效的Javascript語法嗎?它有什麼作用?Javascript原型語法
Parser.prototype = {
// ...
get currentState() {
return this.state[this.state.length - 1];
},
// ...
}
請參閱https://github.com/LearnBoost/stylus/blob/master/lib/parser.js。
謝謝!
它在ECMAScript 5中引入,IE9是第一個帶有功能ES5引擎的瀏覽器。 – user123444555621 2011-02-13 11:34:14