JavaScript:, how do I call methods in other object prototype chains?

object An is an empty object

all the required methods in the prototype chain of object B

A method in the prototype chain _ proto_ of the B object I want the An object to also call

is it feasible to directly use methods such as call and apply?

Mar.07,2021

if you can implement
call and apply by inheritance, you need to refer directly to the object where the target object method resides
to understand the prototype and inheritance. Please refer to the series of articles " javascript Advanced programming Notes: prototype diagram


you can use var A=Object.create (B),. So the prototype delegate of A points to B


https://codeshelper.com/a/11.

"
Menu