Jason Jeffries

33%
Flag icon
Next, we augment that, adding the privileged methods that make up the object's interface. We can assign new functions to members of that. Or, more securely, we can define the functions first as private methods, and then assign them to that: var methodical = function (  ) {     ... }; that.methodical = methodical; The advantage to defining methodical in two steps is that if other methods want to call methodical, they can call methodical( ) instead of that.methodical( ). If the instance is damaged or tampered with so that that.methodical is replaced, the methods that call methodical will ...more
JavaScript: The Good Parts: The Good Parts
Rate this book
Clear rating
Open Preview