❑ Array Object
❑ Boolean Object
❑ Date Object
❑ Math Object
❑ Number Object
❑ String Object
❑ RegExp Object
❑ Global Properties and Functions
Array Object
“JavaScript Array Object.”
Array Object properties
property description
constructor Returns the function that created the Array object’s prototype
length Sets or returns the number of elements in an array
prototype Allows you to add properties and methods to an object
concat() Joins two or more arrays, and returns a copy of the joined arrays
join() Joins all elements of an array into a string
pop() Removes the last element of an array, and returns that element
push() Adds new elements to the end of an array, and returns the new length
reverse() Reverses the order of the elements in an array
shift() Removes the first element of an array, and returns that element
slice() Selects a part of an array, and returns the new array
sort() Sorts the elements of an array
splice() Adds/Removes elements from an array
toString() Converts an array to a string, and returns the result
unshift() Adds new elements to the beginning of an array, and returns the new
length
valueOf() Returns the primitive value of an array as values separated by commas
boolean Object
The Boolean object is used to convert a non-Boolean value to a Boolean value (true
or false).
boolean Object properties
property description
constructor Returns the function that created the Boolean object’s prototype
prototype Allows you to add properties and methods to an object
boolean Object Methods
Method description
toString() Converts a Boolean value to a string, and returns the result
valueOf() Returns the primitive value of a Boolean object
date Object
The Date object is used to work with dates and times.
Date objects are created with new Date().
There are four ways of instantiating a date:
var d = new Date();
var d = new Date(milliseconds);
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds,
milliseconds);
For a tutorial about date and times, see Chapter 16, “JavaScript Date
Object.”
date Object properties
property description
constructor Returns the function that created the Date object’s prototype
prototype Allows you to add properties and methods to an object
date Object Methods
Method description
getDate() Returns the day of the month (from 1–31)
getDay() Returns the day of the week (from 0–6)
getFullYear() Returns the year (four digits)
getHours() Returns the hour (from 0–23)
getMilliseconds() Returns the milliseconds (from 0–999)
getMinutes() Returns the minutes (from 0–59)
getMonth() Returns the month (from 0–11)
getSeconds() Returns the seconds (from 0–59)
getTime() Returns the number of milliseconds since midnight January 1,
1970
getTimezoneOffset() Returns the time difference between GMT and local time in
minutes
getUTCDate() Returns the day of the month, according to universal time (from
1–31)
getUTCDay() Returns the day of the week, according to universal time (from
0–6)
getUTCFullYear() Returns the year, according to universal time (four digits)
getUTCHours() Returns the hour, according to universal time (from 0–23)
getUTCMilliseconds() Returns the milliseconds, according to universal time (from 0–999)
getUTCMinutes() Returns the minutes, according to universal time (from 0–59)
getUTCMonth() Returns the month, according to universal time (from 0–11)
getUTCSeconds() Returns the seconds, according to universal time (from 0–59)
getYear() Deprecated. Use the getFullYear() method instead
parse() Parses a date string and returns the number of milliseconds since
midnight of January 1, 1970
setDate() Sets the day of the month (from 1–31)
(continued)
setFullYear() Sets the year (four digits)
setHours() Sets the hour (from 0–23)
setMilliseconds() Sets the milliseconds (from 0–999)
setMinutes() Set the minutes (from 0–59)
setMonth() Sets the month (from 0–11)
setSeconds() Sets the seconds (from 0–59)
setTime() Sets a date and time by adding or subtracting a specified number
of milliseconds to/from midnight January 1, 1970
setUTCDate() Sets the day of the month, according to universal time (from 1–31)
setUTCFullYear() Sets the year, according to universal time (four digits)
setUTCHours() Sets the hour, according to universal time (from 0–23)
setUTCMilliseconds() Sets the milliseconds, according to universal time (from 0–999)
setUTCMinutes() Set the minutes, according to universal time (from 0–59)
setUTCMonth() Sets the month, according to universal time (from 0–11)
setUTCSeconds() Set the seconds, according to universal time (from 0–59)
setYear() Deprecated. Use the setFullYear() method instead
toDateString() Converts the date portion of a Date object into a readable string
toGMTString() Deprecated. Use the toUTCString() method instead
toLocaleDateString() Returns the date portion of a Date object as a string, using locale
conventions
toLocaleTimeString() Returns the time portion of a Date object as a string, using locale
conventions
toLocaleString() Converts a Date object to a string, using locale conventions
toString() Converts a Date object to a string
toTimeString() Converts the time portion of a Date object to a string
toUTCString() Converts a Date object to a string, according to universal time
UTC() Returns the number of milliseconds in a date string since mid-night of January 1, 1970, according to universal time
valueOf() Converts a Date to milliseconds. Same as getTime().
Math Object
The Math object allows you to perform mathematical tasks.
Math is not a constructor. All properties/methods of Math can be called by using
Math as an object, without creating it.
The syntax is as follows:
var x = Math.PI; // Returns PI
var y = Math.sqrt(16); // Returns the square root of 16
For a tutorial about the Math object, see Chapter 19, “JavaScript Math
Object.”
(continued)
E Returns Euler’s number, the base of the natural logarithm (approx.
2.718)
LN2 Returns the natural logarithm of 2 (approx. 0.693)
LN10 Returns the natural logarithm of 10 (approx. 2.302)
LOG2E Returns the base-2 logarithm of E (approx. 1.442)
LOG10E Returns the base-10 logarithm of E (approx. 0.434)
PI Returns PI (approx. 3.14159)
SQRT1_2 Returns the square root of 1/2 (approx. 0.707)
SQRT2 Returns the square root of 2 (approx. 1.414)
Math Object Methods
Method description
abs(x) Returns the absolute value of x
acos(x) Returns the arccosine of x, in radians
asin(x) Returns the arcsine of x, in radians
atan(x)
Returns the arctangent of xas a numeric value between –PI/2 and PI/2
radians
atan2(y,x) Returns the arctangent of the quotient of its arguments
ceil(x) Returns x, rounded upward to the nearest integer
cos(x) Returns the cosine of x(xis in radians)
exp(x) Returns the value of E to the power of x
floor(x) Returns x, rounded downward to the nearest integer
log(x) Returns the natural logarithm (base E) of x
max(x,y,z,...,n) Returns the number with the highest value
min(x,y,z,...,n) Returns the number with the lowest value
pow(x,y) Returns the value of xto the power of y
random() Returns a random number between 0 and 1
round(x) Rounds xto the nearest integer
sin(x) Returns the sine of x(xis in radians)
sqrt(x) Returns the square root of x
tan(x) Returns the tangent of x(xis in radians)
number Object
The Number object is an object wrapper for primitive numeric values.
Number objects are created with new Number().
The syntax is as follows:
var num = new Number(value);
constructor Returns the function that created the Number object’s prototype
MAX_VALUE Returns the largest number possible in JavaScript
MIN_VALUE Returns the smallest number possible in JavaScript
NEGATIVE _INFINITY Represents negative infinity (returned on overflow)
POSITIVE_INFINITY Represents infinity (returned on overflow)
prototype Allows you to add properties and methods to an object
number Object Methods
Method description
toExponential(x) Converts a number to exponential notation
toFixed(x) Formats a number with xnumber of digits after the decimal point
toPrecision(x) Formats a number to xsignificant digits
toString() Converts a Number object to a string
valueOf() Returns the primitive value of a Number object
String Object
The String object is used to manipulate a stored piece of text.
String objects are created with new String().
The syntax is as follows:
var txt = new String(string);
or more simply:
var txt = string;
For a tutorial about the String object, see Chapter 15, “JavaScript String
Object.”
String Object properties
property description
constructor Returns the function that created the String object’s prototype
length Returns the length of a string
prototype Allows you to add properties and methods to an object
If the value parameter cannot be converted into a number, it returns NaN
(Not-a-Number).
nOt e
Method description
charAt() Returns the character at the specified index
charCodeAt() Returns the Unicode of the character at the specified index
concat() Joins two or more strings, and returns a copy of the joined strings
fromCharCode() Converts Unicode values to characters
indexOf() Returns the position of the first found occurrence of a specified value
in a string
lastIndexOf() Returns the position of the last found occurrence of a specified value
in a string
match() Searches for a match within the string using a regular expression.
Returns an array or null if no matches found.
replace() Searches for a match between a substring (or regular expression) and a
string, and replaces the matched substring with a new substring
search() Searches for a match between a regular expression and a string, and
returns the position of the match or –1 if not found
slice() Extracts a part of a string and returns a new string
split() Splits a string into an array of substrings
substr() Extracts the characters from a string, beginning at a specified start
position through the specified number of characters
substring() Extracts the characters from a string, between two specified indices
toLowerCase() Converts a string to lowercase letters
toUpperCase() Converts a string to uppercase letters
valueOf() Returns the primitive value of a String object
String HtML Wrapper Methods
The HTML wrapper methods return the string wrapped inside the appropriate
HTML tag.
Method description
anchor() Creates an anchor
big() Displays a string using a big font
blink() Displays a blinking string
bold() Displays a string in bold
fixed() Displays a string using a fixed-pitch font
fontcolor() Displays a string using a specified color
fontsize() Displays a string using a specified size
italics() Displays a string in italic
link() Displays a string as a hyperlink
small() Displays a string using a small font
strike() Displays a string with a strikethrough
sub() Displays a string as subscript text
sup() Displays a string as superscript text
Learn JavaScript and Ajax with w3schools
210
regexp Object
A regular expression is an object that describes a pattern of characters.
Regular expressions are used to perform pattern-matching and search-and-replace
functions on text.
The syntax is as follows:
var txt=new RegExp(pattern,modifiers);
or more simply:
var txt=/pattern/modifiers;
8 Pattern specifies the pattern of an expression.
8 Modifiers specify whether a search should be global, case-sensitive, and so on.
For a tutorial about the RegExp object, see Chapter 20, “JavaScript RegExp
Object.”
Modifiers
Modifiers are used to perform case-insensitive and global searches:
Modifier description
i Perform case-insensitive matching
g
Perform a global match (find all matches rather than stopping after
the first match)
m Perform multiline matching
brackets
Brackets are used to find a range of characters:
expression description
[abc] Match any character between the brackets
[^abc] Match any character not between the brackets
[0-9] Match any digit from 0 to 9
[a-z] Match any character from lowercase a to lowercase z
[A-Z] Match any character from uppercase A to uppercase Z
[a-Z] Match any character from lowercase a to uppercase Z
[adgk] Match any character in the given set
[^adgk] Match any character outside the given set
[red|blue|green] Match any of the alternatives specified
Metacharacters are characters with a special meaning:
Metacharacter description
. Find a single character, except newline or line terminator
\w Match any alphanumeric character, including the underscore
\W Match any nonalphanumeric character
\d Find a digit
\D Find a nondigit character
\s Find a single whitespace character
\S Find a single nonwhitespace character
\b Match at the beginning/end of a word
\B Match not at the beginning/end of a word
\0 Find a NUL character
\n Find a new line
\f Find a form feed
\r Find a carriage return
\t Find a tab
\v Find a vertical tab
\xxx Find the character specified by an octal number xxx
\xdd Find the character specified by a hexadecimal number dd
\uxxxx Find the Unicode character specified by a hexadecimal number
xxxx
Quantifiers
Quantifier description
+ Match the preceding character 1 or more times
* Match the preceding character 0 or more times
? Match the preceding character 0 or 1 time
{x} Where x is a positive integer, matches exactly n occurrences of the
preceding character
{x,y} Where x and y are positive integers, matches at least x and no more
than y occurrences of the preceding character
{x,} Where x is a positive integer, matches at least n occurrences of the
preceding character
n$ Matches any string with nat the end of it
^n Matches any string with nat the beginning of it
n(?=m) Matches n only if followed by m
n(?|m) Matches n only if not followed by
global Specifies if the “g” modifier is set
ignoreCase Specifies if the “i” modifier is set
lastIndex The index at which to start the next match
multiline Specifies if the “m” modifier is set
source The text of the RegExp pattern
regexp Object Methods
Method description
compile() Compiles a regular expression
exec() Tests for a match in a string. Returns a result array
test() Tests for a match in a string. Returns true or false
JavaScript Global properties and
Functions
The JavaScript global properties and functions can be used with all the built-in
JavaScript objects.
JavaScript Global properties
property description
Infinity A numeric value that represents positive/negative infinity
NaN “Not-a-Number” value
undefined Indicates that a variable has not been assigned a value
JavaScript Global Functions
Function description
decodeURI() Decodes a URI
decodeURIComponent() Decodes a URI component
encodeURI() Encodes a URI
encodeURIComponent() Encodes a URI component
escape() Encodes a string
eval()
Evaluates a string and executes it as if it were a JavaScript
expression
isFinite() Determines whether a value is a finite number
isNaN() Determines whether a value is an illegal number
Number() Converts an object’s value to a number
Function description
parseFloat() Parses a string and returns a floating point number
parseInt() Parses a string and returns an integer
String() Converts an object’s value to a string
unescape() Decodes an encoded string
❑ Boolean Object
❑ Date Object
❑ Math Object
❑ Number Object
❑ String Object
❑ RegExp Object
❑ Global Properties and Functions
Array Object
“JavaScript Array Object.”
Array Object properties
property description
constructor Returns the function that created the Array object’s prototype
length Sets or returns the number of elements in an array
prototype Allows you to add properties and methods to an object
concat() Joins two or more arrays, and returns a copy of the joined arrays
join() Joins all elements of an array into a string
pop() Removes the last element of an array, and returns that element
push() Adds new elements to the end of an array, and returns the new length
reverse() Reverses the order of the elements in an array
shift() Removes the first element of an array, and returns that element
slice() Selects a part of an array, and returns the new array
sort() Sorts the elements of an array
splice() Adds/Removes elements from an array
toString() Converts an array to a string, and returns the result
unshift() Adds new elements to the beginning of an array, and returns the new
length
valueOf() Returns the primitive value of an array as values separated by commas
boolean Object
The Boolean object is used to convert a non-Boolean value to a Boolean value (true
or false).
boolean Object properties
property description
constructor Returns the function that created the Boolean object’s prototype
prototype Allows you to add properties and methods to an object
boolean Object Methods
Method description
toString() Converts a Boolean value to a string, and returns the result
valueOf() Returns the primitive value of a Boolean object
date Object
The Date object is used to work with dates and times.
Date objects are created with new Date().
There are four ways of instantiating a date:
var d = new Date();
var d = new Date(milliseconds);
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds,
milliseconds);
For a tutorial about date and times, see Chapter 16, “JavaScript Date
Object.”
date Object properties
property description
constructor Returns the function that created the Date object’s prototype
prototype Allows you to add properties and methods to an object
date Object Methods
Method description
getDate() Returns the day of the month (from 1–31)
getDay() Returns the day of the week (from 0–6)
getFullYear() Returns the year (four digits)
getHours() Returns the hour (from 0–23)
getMilliseconds() Returns the milliseconds (from 0–999)
getMinutes() Returns the minutes (from 0–59)
getMonth() Returns the month (from 0–11)
getSeconds() Returns the seconds (from 0–59)
getTime() Returns the number of milliseconds since midnight January 1,
1970
getTimezoneOffset() Returns the time difference between GMT and local time in
minutes
getUTCDate() Returns the day of the month, according to universal time (from
1–31)
getUTCDay() Returns the day of the week, according to universal time (from
0–6)
getUTCFullYear() Returns the year, according to universal time (four digits)
getUTCHours() Returns the hour, according to universal time (from 0–23)
getUTCMilliseconds() Returns the milliseconds, according to universal time (from 0–999)
getUTCMinutes() Returns the minutes, according to universal time (from 0–59)
getUTCMonth() Returns the month, according to universal time (from 0–11)
getUTCSeconds() Returns the seconds, according to universal time (from 0–59)
getYear() Deprecated. Use the getFullYear() method instead
parse() Parses a date string and returns the number of milliseconds since
midnight of January 1, 1970
setDate() Sets the day of the month (from 1–31)
(continued)
setFullYear() Sets the year (four digits)
setHours() Sets the hour (from 0–23)
setMilliseconds() Sets the milliseconds (from 0–999)
setMinutes() Set the minutes (from 0–59)
setMonth() Sets the month (from 0–11)
setSeconds() Sets the seconds (from 0–59)
setTime() Sets a date and time by adding or subtracting a specified number
of milliseconds to/from midnight January 1, 1970
setUTCDate() Sets the day of the month, according to universal time (from 1–31)
setUTCFullYear() Sets the year, according to universal time (four digits)
setUTCHours() Sets the hour, according to universal time (from 0–23)
setUTCMilliseconds() Sets the milliseconds, according to universal time (from 0–999)
setUTCMinutes() Set the minutes, according to universal time (from 0–59)
setUTCMonth() Sets the month, according to universal time (from 0–11)
setUTCSeconds() Set the seconds, according to universal time (from 0–59)
setYear() Deprecated. Use the setFullYear() method instead
toDateString() Converts the date portion of a Date object into a readable string
toGMTString() Deprecated. Use the toUTCString() method instead
toLocaleDateString() Returns the date portion of a Date object as a string, using locale
conventions
toLocaleTimeString() Returns the time portion of a Date object as a string, using locale
conventions
toLocaleString() Converts a Date object to a string, using locale conventions
toString() Converts a Date object to a string
toTimeString() Converts the time portion of a Date object to a string
toUTCString() Converts a Date object to a string, according to universal time
UTC() Returns the number of milliseconds in a date string since mid-night of January 1, 1970, according to universal time
valueOf() Converts a Date to milliseconds. Same as getTime().
Math Object
The Math object allows you to perform mathematical tasks.
Math is not a constructor. All properties/methods of Math can be called by using
Math as an object, without creating it.
The syntax is as follows:
var x = Math.PI; // Returns PI
var y = Math.sqrt(16); // Returns the square root of 16
For a tutorial about the Math object, see Chapter 19, “JavaScript Math
Object.”
(continued)
E Returns Euler’s number, the base of the natural logarithm (approx.
2.718)
LN2 Returns the natural logarithm of 2 (approx. 0.693)
LN10 Returns the natural logarithm of 10 (approx. 2.302)
LOG2E Returns the base-2 logarithm of E (approx. 1.442)
LOG10E Returns the base-10 logarithm of E (approx. 0.434)
PI Returns PI (approx. 3.14159)
SQRT1_2 Returns the square root of 1/2 (approx. 0.707)
SQRT2 Returns the square root of 2 (approx. 1.414)
Math Object Methods
Method description
abs(x) Returns the absolute value of x
acos(x) Returns the arccosine of x, in radians
asin(x) Returns the arcsine of x, in radians
atan(x)
Returns the arctangent of xas a numeric value between –PI/2 and PI/2
radians
atan2(y,x) Returns the arctangent of the quotient of its arguments
ceil(x) Returns x, rounded upward to the nearest integer
cos(x) Returns the cosine of x(xis in radians)
exp(x) Returns the value of E to the power of x
floor(x) Returns x, rounded downward to the nearest integer
log(x) Returns the natural logarithm (base E) of x
max(x,y,z,...,n) Returns the number with the highest value
min(x,y,z,...,n) Returns the number with the lowest value
pow(x,y) Returns the value of xto the power of y
random() Returns a random number between 0 and 1
round(x) Rounds xto the nearest integer
sin(x) Returns the sine of x(xis in radians)
sqrt(x) Returns the square root of x
tan(x) Returns the tangent of x(xis in radians)
number Object
The Number object is an object wrapper for primitive numeric values.
Number objects are created with new Number().
The syntax is as follows:
var num = new Number(value);
constructor Returns the function that created the Number object’s prototype
MAX_VALUE Returns the largest number possible in JavaScript
MIN_VALUE Returns the smallest number possible in JavaScript
NEGATIVE _INFINITY Represents negative infinity (returned on overflow)
POSITIVE_INFINITY Represents infinity (returned on overflow)
prototype Allows you to add properties and methods to an object
number Object Methods
Method description
toExponential(x) Converts a number to exponential notation
toFixed(x) Formats a number with xnumber of digits after the decimal point
toPrecision(x) Formats a number to xsignificant digits
toString() Converts a Number object to a string
valueOf() Returns the primitive value of a Number object
String Object
The String object is used to manipulate a stored piece of text.
String objects are created with new String().
The syntax is as follows:
var txt = new String(string);
or more simply:
var txt = string;
For a tutorial about the String object, see Chapter 15, “JavaScript String
Object.”
String Object properties
property description
constructor Returns the function that created the String object’s prototype
length Returns the length of a string
prototype Allows you to add properties and methods to an object
If the value parameter cannot be converted into a number, it returns NaN
(Not-a-Number).
nOt e
Method description
charAt() Returns the character at the specified index
charCodeAt() Returns the Unicode of the character at the specified index
concat() Joins two or more strings, and returns a copy of the joined strings
fromCharCode() Converts Unicode values to characters
indexOf() Returns the position of the first found occurrence of a specified value
in a string
lastIndexOf() Returns the position of the last found occurrence of a specified value
in a string
match() Searches for a match within the string using a regular expression.
Returns an array or null if no matches found.
replace() Searches for a match between a substring (or regular expression) and a
string, and replaces the matched substring with a new substring
search() Searches for a match between a regular expression and a string, and
returns the position of the match or –1 if not found
slice() Extracts a part of a string and returns a new string
split() Splits a string into an array of substrings
substr() Extracts the characters from a string, beginning at a specified start
position through the specified number of characters
substring() Extracts the characters from a string, between two specified indices
toLowerCase() Converts a string to lowercase letters
toUpperCase() Converts a string to uppercase letters
valueOf() Returns the primitive value of a String object
String HtML Wrapper Methods
The HTML wrapper methods return the string wrapped inside the appropriate
HTML tag.
Method description
anchor() Creates an anchor
big() Displays a string using a big font
blink() Displays a blinking string
bold() Displays a string in bold
fixed() Displays a string using a fixed-pitch font
fontcolor() Displays a string using a specified color
fontsize() Displays a string using a specified size
italics() Displays a string in italic
link() Displays a string as a hyperlink
small() Displays a string using a small font
strike() Displays a string with a strikethrough
sub() Displays a string as subscript text
sup() Displays a string as superscript text
Learn JavaScript and Ajax with w3schools
210
regexp Object
A regular expression is an object that describes a pattern of characters.
Regular expressions are used to perform pattern-matching and search-and-replace
functions on text.
The syntax is as follows:
var txt=new RegExp(pattern,modifiers);
or more simply:
var txt=/pattern/modifiers;
8 Pattern specifies the pattern of an expression.
8 Modifiers specify whether a search should be global, case-sensitive, and so on.
For a tutorial about the RegExp object, see Chapter 20, “JavaScript RegExp
Object.”
Modifiers
Modifiers are used to perform case-insensitive and global searches:
Modifier description
i Perform case-insensitive matching
g
Perform a global match (find all matches rather than stopping after
the first match)
m Perform multiline matching
brackets
Brackets are used to find a range of characters:
expression description
[abc] Match any character between the brackets
[^abc] Match any character not between the brackets
[0-9] Match any digit from 0 to 9
[a-z] Match any character from lowercase a to lowercase z
[A-Z] Match any character from uppercase A to uppercase Z
[a-Z] Match any character from lowercase a to uppercase Z
[adgk] Match any character in the given set
[^adgk] Match any character outside the given set
[red|blue|green] Match any of the alternatives specified
Metacharacters are characters with a special meaning:
Metacharacter description
. Find a single character, except newline or line terminator
\w Match any alphanumeric character, including the underscore
\W Match any nonalphanumeric character
\d Find a digit
\D Find a nondigit character
\s Find a single whitespace character
\S Find a single nonwhitespace character
\b Match at the beginning/end of a word
\B Match not at the beginning/end of a word
\0 Find a NUL character
\n Find a new line
\f Find a form feed
\r Find a carriage return
\t Find a tab
\v Find a vertical tab
\xxx Find the character specified by an octal number xxx
\xdd Find the character specified by a hexadecimal number dd
\uxxxx Find the Unicode character specified by a hexadecimal number
xxxx
Quantifiers
Quantifier description
+ Match the preceding character 1 or more times
* Match the preceding character 0 or more times
? Match the preceding character 0 or 1 time
{x} Where x is a positive integer, matches exactly n occurrences of the
preceding character
{x,y} Where x and y are positive integers, matches at least x and no more
than y occurrences of the preceding character
{x,} Where x is a positive integer, matches at least n occurrences of the
preceding character
n$ Matches any string with nat the end of it
^n Matches any string with nat the beginning of it
n(?=m) Matches n only if followed by m
n(?|m) Matches n only if not followed by
global Specifies if the “g” modifier is set
ignoreCase Specifies if the “i” modifier is set
lastIndex The index at which to start the next match
multiline Specifies if the “m” modifier is set
source The text of the RegExp pattern
regexp Object Methods
Method description
compile() Compiles a regular expression
exec() Tests for a match in a string. Returns a result array
test() Tests for a match in a string. Returns true or false
JavaScript Global properties and
Functions
The JavaScript global properties and functions can be used with all the built-in
JavaScript objects.
JavaScript Global properties
property description
Infinity A numeric value that represents positive/negative infinity
NaN “Not-a-Number” value
undefined Indicates that a variable has not been assigned a value
JavaScript Global Functions
Function description
decodeURI() Decodes a URI
decodeURIComponent() Decodes a URI component
encodeURI() Encodes a URI
encodeURIComponent() Encodes a URI component
escape() Encodes a string
eval()
Evaluates a string and executes it as if it were a JavaScript
expression
isFinite() Determines whether a value is a finite number
isNaN() Determines whether a value is an illegal number
Number() Converts an object’s value to a number
Function description
parseFloat() Parses a string and returns a floating point number
parseInt() Parses a string and returns an integer
String() Converts an object’s value to a string
unescape() Decodes an encoded string
0 comments:
Post a Comment