Skip to content

【提案】支持类似kotlin的object关键词,用来解决静态方法无法被继承后重写的问题 #71

Answered by Jack-Works
alamhubb asked this question in Ideas
Discussion options

You must be logged in to vote

你可以试试

const parent = { f() { console.log(this.name) }, name: 'parent' }
const child = { __proto__: parent, f() { super.f(); console.log('from child') }, name: 'child' }
child.f()

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@alamhubb
Comment options

@ljharb
Comment options

Answer selected by hax
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants