0

when reading documentation for a language such as is, what does prototype refer too. string.prototype.toString()

Js Documentation

30th May 2021, 1:06 PM
Edward Jackson Jr
Edward Jackson Jr - avatar
3 Respostas
+ 2
Prototypes are the mechanism by which JavaScript objects inherit features from one another. In this article, we explain how prototype chains work and look at how the prototype property can be used to add methods to existing constructors. https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes
30th May 2021, 1:23 PM
Matias
Matias - avatar
+ 1
Martin Taylor, Thanks!!
30th May 2021, 7:12 PM
Matias
Matias - avatar
0
JS is an Object Oriented Programming language... roughly, there is two kind of implementing OOP: by classes, and by prototyping. most of OOP languages uses classes, while JS use prototype... even in latest version where it has introduced the syntactic sugar of 'classes' (internally, that's still implemented using prototyping ;P consider that both class and prototype based OOP define a blueprint used to build objects of same kind/family... A good source reference to dive into the prototype specificities mechanic used in JS is the mdn site: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
30th May 2021, 5:35 PM
visph
visph - avatar