Skip to content
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