The document discusses JavaScript's prototype property and object-oriented programming. It explains that in JavaScript, objects inherit properties and methods from a prototype object, allowing for code reuse and extension of functionality. The prototype is an object that is shared among objects created from the same constructor function. All objects in JavaScript inherit from the Object prototype by default.
1 of 77
Downloaded 39 times
More Related Content
JavaScript: The prototype Property
1. JavaScript
The prototype Property
Thursday, November 1, 12
16. JavaScript OOP
Aplicar JavaScript OOP
Thursday, November 1, 12
17. JavaScript is a
prototypal language
Thursday, November 1, 12
18. Prototype-based
programming
Class free
Classes are not present
Not Object Oriented
Everything is public
Objects inherits from another objects
Thursday, November 1, 12
46. Constructor
Functions
Classes
Create diferents instances ==> Objects
Use new operator
Accepts parameters
Returns an instance ==> Object
Thursday, November 1, 12
52. Prototype
A property
Defines properties and methods to all
instances
Works with new operator
Stored in the memory once
Contain an Object
initial value === empty Object === {}
Thursday, November 1, 12
61. Inheritance
A new “class” is created from another “class”
Extends functionality
Defines new attributes and methods
A way to reuse code
All Object inherit from Object.prototype
12+ ways to inherits in JS
Thursday, November 1, 12