JavaScript: The prototype Property

F8a70e01eddbadc5e4f9876ff34494fa?s=47 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.

F8a70e01eddbadc5e4f9876ff34494fa?s=128

Guille Paz

November 01, 2012
Tweet

Transcript

  1. JavaScript The prototype Property Thursday, November 1, 12

  2. Brief What’s OOP? JavaScript OOP Prototype Inheritance Thursday, November 1,

    12
  3. What’s OOP? Introducir a OOP Presentar el vocabulario Thursday, November

    1, 12
  4. Object Oriented Programming Thursday, November 1, 12

  5. Programming paradigm Thursday, November 1, 12

  6. Data abstraction Encapsulation Messaging Modularity Polymorphism Inheritance Thursday, November 1,

    12
  7. Use object based on the real world Thursday, November 1,

    12
  8. Class vs Object Thursday, November 1, 12

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

    as color Methods An object capability, such as walk Thursday, November 1, 12
  10. Objects A instance of a Class Share properties and behavior

    Unique Thursday, November 1, 12
  11. Class Thursday, November 1, 12

  12. Class Object1 Thursday, November 1, 12

  13. Class Object1 Object2 Thursday, November 1, 12

  14. Class Object1 Object2 Object3 Thursday, November 1, 12

  15. Exercise 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
  19. Objects in JavaScript Thursday, November 1, 12

  20. Everything is an object Thursday, November 1, 12

  21. Everything is an object Arrays Thursday, November 1, 12

  22. Everything is an object Arrays Dates Thursday, November 1, 12

  23. Everything is an object Arrays Objects Dates Thursday, November 1,

    12
  24. Everything is an object Arrays Objects Dates Strings Thursday, November

    1, 12
  25. Everything is an object Arrays Objects Numbers Dates Strings Thursday,

    November 1, 12
  26. They have methods and properties Thursday, November 1, 12

  27. Thursday, November 1, 12

  28. Thursday, November 1, 12

  29. Thursday, November 1, 12

  30. Thursday, November 1, 12

  31. Custom Objects Thursday, November 1, 12

  32. Thursday, November 1, 12

  33. Thursday, November 1, 12

  34. Thursday, November 1, 12

  35. Thursday, November 1, 12

  36. Thursday, November 1, 12

  37. Thursday, November 1, 12

  38. Thursday, November 1, 12

  39. Thursday, November 1, 12

  40. Thursday, November 1, 12

  41. Not reuse Thursday, November 1, 12

  42. Not reuse Unique Thursday, November 1, 12

  43. Not reuse Unique Singleton Pattern Thursday, November 1, 12

  44. Exercise Thursday, November 1, 12

  45. Constructors 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
  47. Thursday, November 1, 12

  48. Thursday, November 1, 12

  49. Constructor Has properties and methods length constructor apply() call() prototype

    Thursday, November 1, 12
  50. Thursday, November 1, 12

  51. Prototype 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
  53. Thursday, November 1, 12

  54. Thursday, November 1, 12

  55. Thursday, November 1, 12

  56. Thursday, November 1, 12

  57. Thursday, November 1, 12

  58. Thursday, November 1, 12

  59. Thursday, November 1, 12

  60. Inheritance 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
  62. Prototype Chaining Pseudo-clasical Thursday, November 1, 12

  63. Thursday, November 1, 12

  64. Thursday, November 1, 12

  65. Thursday, November 1, 12

  66. Thursday, November 1, 12

  67. Thursday, November 1, 12

  68. Thursday, November 1, 12

  69. Thursday, November 1, 12

  70. Thursday, November 1, 12

  71. Thursday, November 1, 12

  72. Thursday, November 1, 12

  73. Thursday, November 1, 12

  74. Inherited Thursday, November 1, 12

  75. Inherited Thursday, November 1, 12

  76. Own Thursday, November 1, 12

  77. The End Thursday, November 1, 12