📘super
JS ⟩ value ⟩ object ⟩ class ⟩ inheritance ⟩ super
access properties on object literal / class's prototype object. (
super.prop
/super[expr]
are valid in any method definition in object literal / class)invoke superclass constructor. (
super(...args)
is valid in class constructors)
super
is not a variable that points to the prototype object❗
attempting to read super itself is a
SyntaxError
❗
arrow functions do not have
super
. (👉 see: Arrow functions revisited)If accessed, it’s taken from the outer function.
👉 see: JavaScript.info
💾 程式: replit
Last updated
Was this helpful?