This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PROTOTYPE | |
// Modularize code into re-usable objects, take variables and functions out of global namespace, | |
// functions loaded into memory once whereas the state is all held in the objects, can override | |
// functions through prototyping. | |
// Drawbacks: heavy use of 'this' keyword and the constructor is separate from the prototype definition. | |
var Calculator = function(eq) { | |
// Variables defined in constructor and are unique to each instance. | |
this.eqCtl = document.GetElementById(eq); |
NewerOlder