S
S
sunny_puppy2017-11-19 04:23:05
JavaScript
sunny_puppy, 2017-11-19 04:23:05

Is the prototype method instance member or static?

Is the prototype method an instance member or a static member?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
youngmysteriouslight, 2017-11-19
@sunny_puppy

Traditionally, prototype methods are referred to as static methods.
If we compare the prototype organization of objects and the class organization, all fields (and, as a result, methods) of the prototype are the same for all objects with this prototype (if they do not have their own fields with the same key), that is, two different objects with the same prototype have the same value those fields whose value is determined by the prototype. This corresponds to static members of the class, which are also the same for all instances of the class.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question