Interface JSFunctionFunctions

    • Method Detail

      • apply

        JSObject apply​(JSObject thisObject,
                       JSArray argArray)
        function apply (thisObject, argArray) invoke a function as a method of an object.

        Example

         //Apply the default  Object.toString() method to an object that
         //overrides it with its own version of the method
         Object.prototype.toString().apply(o);
         
        Parameters:
        thisObject - The object to which the function is applied.
        argArray - An array of arguments to be passed to function
        Returns:
        Whatever value is returned by function
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Function
      • call

        JSObject call​(JSObject thisObject,
                      JSObject args)
        function call (thisObject, args) invoke a function as a method of an object

        Example

         //Call the default  Object.toString() method to an object that
         //overrides it with its own version of the method
         Object.prototype.toString().call(o);
         
        Parameters:
        thisObject - The object to which the function is applied.
        args - An array of arguments to be passed to function
        Returns:
        Whatever value is returned by function
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Function