JavaScript Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Java-Script Tutorial
Introduction Introduction
Variables Variables
Operators Operators
Statements Statements
Loops Loops
Functions Functions
Objects Objects
Arrays Arrays
Cookies JS Cookies
Browser Objects Browser Objects
Form DOM Form DOM
Style Objects DOM Style Objects
Forums Ask Your Doubts
Scraps More about Javascript
Feedback Feedback
 




Global Object Methods


Tutorials Javascript

Topic

global object methods in javascript?



Explanation
      Global object is defined to associate an object with globally accessible variables and functions defined in previous versions of javascript. This method can be used or referenced directly.

The below table lists the methods that are available in global objects
MethodExample CodeResultDescription
escape(string) escape("test val"); escape(string) method converts the special characters like space, colon etc of the given string in to escape sequences.
eval(expression) eval(2*(3+5)); eval method evaluates a regular expression and returns the result.
isFinite(number) isFinite(234455); isFinite(number) method returns true if the number is finite, else false.
isNaN(value) isNaN(23); isNaN function validate the argument for a number and returns true if the given value is not a number else returns false.
unescape(string) unescape("test%20val"); unescape(string); function replaces the escape sequences with original values. %20 is the escape sequence for space " ".

Thus the global object functions can be used to evaluate a regular expression (eval), validate a number (isNaN), handle escape characters, etc..



A Note
Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

Other Links

web hosting