Interface JSGlobalFunctions

    • Method Detail

      • escape

        JSString escape​(JSString s)
        function escape(s) encode a string.
        Parameters:
        s - A string to be "escaped" or encoded.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global, encodeURI(), encodeURIComponent()
      • eval

        JSObject eval​(JSString code)
        function eval(code) execute JavaScript from a string.

        Example

         eval("2+5"); //Returns 7
         
        Parameters:
        code - A string that contains the JavaScript expression to be evaluated or the statements to be executed.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global
      • isFinite

        JSBoolean isFinite​(JSNumber n)
        function isFinite(n) determine whether a number is finite.
        Parameters:
        n - The number to be tested.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global, NaN, Number.POSITIVE_INFINITY
      • isNaN

        JSBoolean isNaN​(JSNumber n)
        function isNaN(n) check for not-a-number.

        Example

         isNaN(0); // => false
         isNaN(0/0); //=> true
         isNaN(parseInt("3")); //=> false
         isNaN(parseInt("hello")); //=> true
         isNaN("3"); //=> false
         isNaN("hello"); //=gt; true
         isNaN(true); //=> false
         isNaN(undefined); //=> true
         
        Parameters:
        n - The number to be tested.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global, NaN, Number.NaN, parseFloat(), parseInt()
      • parseFloat

        JSString parseFloat​(JSString s)
        function parseFloat(s) convert a string to a number.
        Parameters:
        s - The string to be parsed and converted to a number
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global, isNan(), parseInt()
      • parseInt

        JSString parseInt​(JSString s,
                          JSNumber radix)
        function parseInt(s, radix) convert a string to an integer.
        Parameters:
        s - The string to be parsed and converted to an integer
        radix - An optional integer argument that represents the radix (i.e. base) of the number to be parsed. If omitted or 0, the number is parsed in base 10.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global, isNan(), parseFloat()
      • unescape

        JSString unescape​(JSString s)
        function unescape(s) decode an escaped string.
        Parameters:
        s - A string to be "unescaped" or decoded.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Global, decodeURI(), decodeURIComponent()