Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaScript: The prototype Property

Guille Paz
November 01, 2012

JavaScript: The prototype Property

JavaScript has strong object-oriented programming capabilities, even though some debates have taken place due to the differences in object-oriented JavaScript compared to other languages.

Guille Paz

November 01, 2012
Tweet

More Decks by Guille Paz

Other Decks in Programming

Transcript

  1. Class A Class defines Objects Properties An object characteristic, such

    as color Methods An object capability, such as walk Thursday, November 1, 12
  2. Prototype-based programming Class free Classes are not present Not Object

    Oriented Everything is public Objects inherits from another objects Thursday, November 1, 12
  3. Constructor Functions Classes Create diferents instances ==> Objects Use new

    operator Accepts parameters Returns an instance ==> Object Thursday, November 1, 12
  4. 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
  5. 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