• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Independent Functions, Operators, Variables, and Literals

Independent Functions, Operators, Variables, and Literals

The following subsections describe the functions, operators, variables, and literals that are built in to JavaScript, without being attached to a specific JavaScript object.

Independent Functions

  • escape(character)— Returns a string containing the ASCII encoding of character in the form %xx; xx is the numeric encoding of the character. (2|3|I)

  • eval(expression)— Returns the result of evaluating expression, which is an arithmetic expression. (2|3|I)

  • isNaN(value)— Evaluates value to see if it's NaN. Returns a Boolean value. (2|3|I) (On UNIX platforms, not 2)

  • parseFloat(string)— Converts string to a floating-point number and returns the value. It continues to convert until it hits a non-numeric character and then returns the result. If the first character can't be converted to a number, the function returns NaN (zero on Windows platforms). (2|3|I)

  • parseInt(string,base)— Converts string to an integer of base base and returns the value. It continues to convert until it hits a non-numeric character and then returns the result. If the first character can't be converted to a number, the function returns NaN (zero on Windows platforms). (2|3|I)

  • taint(propertyName)— Adds tainting to propertyName. (3)

  • toString()— This is a method of all objects. It returns the object as a string or returns "[object type]" if no string representation exists for the object. (2|3) Note: In JavaScript 1.2, it converts objects and strings into literals.

  • unescape(string)— Returns a character based on the ASCII encoding contained in string. The ASCII encoding should take the form "%integer" or "hexadecimalValue". (2|3|I)

  • untaint(propertyName)— Removes tainting from propertyName. (3)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint