这是有效的Javascript语法吗?它有什么作用?
Parser.prototype = {
// ...
get currentState() {
return this.state[this.state.length - 1];
},
// ...
}
Run Code Online (Sandbox Code Playgroud)
请参阅https://github.com/LearnBoost/stylus/blob/master/lib/parser.js.
谢谢!