Show TOC

Normal MethodsLocate this document in the navigation structure

Normal or public methods comprise all methods that do not belong to one of the special method types.

All methods are appended to the implementation object. Private methods are identified by a name starting with an underscore and must not be called from outside the control. The following code snippet is an example for the public method divide that calls the private helper method _checkForZero within the control:

  divide: function(x, y) {     // a public method of the Control

      if (this._checkForZero(y)) {

         throw new Error("Second parameter may not be zero");

      }

      return x / y;

   },



   _checkForZero: function(y) { // private helper method

      if (y === 0) {

         return true;

      }

      return false;

   }