ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
JavaScript
Patterns and Techniques
What exactly JS is ?
¡ñ Ecma Script implementation
Currently most browsers fully supports EcmaScript-262 5.1 http://kangax.github.io/compat-
table/es5/
Except IE8 - supports EcmaSript 3rd edition (FYI: there was not ES 4)
Previous releases http://www.ecma-international.org/publications/standards/Ecma-262.htm
¡ñ Prototype Based
¡ñ Dynamically typed
¡ñ First Class Functions
¡ñ Object Oriented, Functional, Imperative
Creating an object
¡ñ Object Literals
¡ñ Anonymous Constructor
¡ñ Factory method
¡ñ Wrappers
creating_object1.js
Setting properties to object
¡ñ Dot Notation
¡ñ Square brackets notation
¡ñ Helper methods from Object
setting_properties1.js
Writing constructors aka defining Classes
¡ñ Function vs Constructor
¡ñ Function¡¯s prototype
¡ñ __proto__
¡ñ polimorphism
constructor.js
Privacy in Java Script
¡ñ Variables scope in JS
¡ñ Private Class Members
privacy.js, privacy2.js
Modules in JavaScript
Module is set of methods and properties, with
or without state.
¡ñ Simple module modules.js
¡ñ Private state in modules modules2.js
¡ñ Revealing Module Pattenr
to be continued
Thank you

More Related Content

JS patterns

  • 2. What exactly JS is ? ¡ñ Ecma Script implementation Currently most browsers fully supports EcmaScript-262 5.1 http://kangax.github.io/compat- table/es5/ Except IE8 - supports EcmaSript 3rd edition (FYI: there was not ES 4) Previous releases http://www.ecma-international.org/publications/standards/Ecma-262.htm ¡ñ Prototype Based ¡ñ Dynamically typed ¡ñ First Class Functions ¡ñ Object Oriented, Functional, Imperative
  • 3. Creating an object ¡ñ Object Literals ¡ñ Anonymous Constructor ¡ñ Factory method ¡ñ Wrappers creating_object1.js
  • 4. Setting properties to object ¡ñ Dot Notation ¡ñ Square brackets notation ¡ñ Helper methods from Object setting_properties1.js
  • 5. Writing constructors aka defining Classes ¡ñ Function vs Constructor ¡ñ Function¡¯s prototype ¡ñ __proto__ ¡ñ polimorphism constructor.js
  • 6. Privacy in Java Script ¡ñ Variables scope in JS ¡ñ Private Class Members privacy.js, privacy2.js
  • 7. Modules in JavaScript Module is set of methods and properties, with or without state. ¡ñ Simple module modules.js ¡ñ Private state in modules modules2.js ¡ñ Revealing Module Pattenr