How does inheritance of static methods differ from that of instance methods in ES6?
- Static methods cannot be inherited.
- Static methods are inherited through the prototype chain.
- Static methods are inherited using the extends keyword.
- Static methods are inherited through the super keyword.
In ES6, static methods are inherited through the prototype chain, just like instance methods. The key difference lies in how they are called and accessed. The extends keyword is used to inherit static methods, making them accessible through the derived class. Option B is the correct answer.
Loading...
Related Quiz
- When applied to a string, the spread operator will split it into individual '__________'.
- The _________ method executes a provided function once for each array element.
- If you're building a library with a primary functionality and several auxiliary functions, how would you organize your exports?
- What is a static method in an ES6 class?
- ES6 enables deeper recursion without a stack overflow by using _________ tail calls.