Advanced JavaScript Concepts

11,647 views

Published on

Topics covered: Closure, Callback, Module Pattern, Cascading, Curry, Inheritance, Pseudo Classical, Prototype

Published in: Technology
  • Be the first to comment

Advanced JavaScript Concepts

  1. 1. var Calculator = function() { //private variables //private functions return { //public members };};
  2. 2. var Calculator = function(eq) { //private member var eqCtl = document.getElementById(eq); return { var calculator = new Calculator(eq); //expose public member calculator.add(2,2) add: function(x,y) { var val = x + y; eqCtl.innerHTML = val; } };};
  3. 3. newObject oldObject
  4. 4. car vehicle
  5. 5. newObject Constructor.prototype

×