0
What is a prototype function in Javascript
Javascript
3 ответов
+ 4
Te refieres a este tipo de funciones?
https://code.sololearn.com/cMnrTm5QGZZ1/?ref=app
+ 1
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
+ 1
when google is there...
then why asking here??
//
https://www.tutorialsteacher.com/javascript/prototype-in-javascript
https://www.w3schools.com/js/js_object_prototypes.asp
https://www.programiz.com/javascript/prototype