Open Directory Site JavaScript Tutorials

ASP | XML | VBScript | JavaScript | ADO | CSS | XMLDOM | PHP | Operating Systems

Home >> JavaScript >>  JavaScript Reference

 JavaScript Reference

 

JS Objects

The Boolean object

Methods Explanation NN IE ECMA

toString() Returns a string Boolean value. (true or false) 3.0 3.0 1.0

valueOff() Returns the value of the specified object 4.0 4.0 1.0

The String object

Methods Explanation NN IE ECMA

length Returns the length of the string 2.0 3.0 1.0

anchor() Returns the string as an anchor: <a>string</a> 2.0 3.0

big() Returns the string, formatted to big: <big>string</big> 2.0 3.0

blink() Returns the string blinking: <blink>string</blink> 2.0

bold() Returns the string bold: <b>string</b> 2.0 3.0

charAt() Returns the character at the specified index 2.0 3.0 1.0

charCodeAt() Returns the Unicode of the specified indexed character 4.0 4.0 1.0

concat() Returns two concatenated strings 4.0 4.0

fixed() Returns the string as teletype text: <tt>string</tt> 2.0 3.0

fontColor() Returns the string in the specified color: <font

color="red">string</font> 2.0 3.0

fontSize() Returns the string in the specified size: <font

size="5">string</font> 2.0 3.0

fromCharCode() The charCodeAt method vice versa.

Returns the string value of the specified

Unicode. 4.0 4.0

indexOf() Returns the index of the first time the specified

character occurs, or -1 if it never occurs, so

with that index you can determine if the string contains

the specified character. 2.0 3.0

italics() Returns the string in italic: <i>string</i> 2.0 3.0

lastIndexOf() Same as indexOf, only it starts from the right and

moves left. 2.0 3.0

link() Returns the string as a hyperlink: <a href="url">

string</a> 2.0 3.0

match() Behaves similar to indexOf and lastIndexOf, but

the match method returns the specified characters,

or "null", instead of a numeric value. 4.0 4.0

replace() Replaces the specified characters with new specified

characters. 4.0 4.0

search() Returns an integer value if the string contains the

specified characters, if not it returns -1. 4.0 4.0

slice() Returns a string containing the specified

character index. 4.0 4.0

small() Returns the string formatted to small:

<small>string</small> 2.0 3.0

split() Replaces the specified characters with a comma. 4.0 4.0 1.0

strike() Returns the string strikethrough:

<strike>string</strike> 2.0 3.0

sub() Returns the string formatted to subscript:

<sub>string</sub> 2.0 3.0

substr() Returns the characters you specified. (14,7)

returns 7 characters, from the 14th character. 4.0 4.0

substring() Returns the characters you specified. (14,7)

returns all characters between the 7th and the 14th. 2.0 3.0 1.0

sup() Returns the string formatted to superscript:

<sup>string</sup> 2.0 3.0

toLowerCase() Returns the string in lower case 2.0 3.0 1.0

toUpperCase() Returns the string in upper case 2.0 3.0 1.0

The Array object

Methods Explanation NN IE ECMA

length Returns number of elements in the array 3.0 4.0 1.0

concat() Returns an array concatenated of two arrays 4.0 4.0 1.0

join() Returns a string of all the elements of an array

concatenated together 3.0 4.0 1.0

reverse() Returns the array reversed 3.0 4.0 1.0

slice() Returns a specified part of the array 4.0 4.0

sort() Returns a sorted array 3.0 4.0 1.0

The Date Object

Methods Explanation NN IE ECMA

Date() Returns a new Date object 2.0 3.0 1.0

getDate() Returns the date from a Date object. (1-31) 2.0 3.0 1.0

getDay() Returns the weekday. (0-6) 2.0 3.0 1.0

getMonth() Returns the month. (0-11) 2.0 3.0 1.0

getFullYear() Returns the year. (2000) 4.0 4.0 1.0

getYear() Returns the year as a 4 digit value (or the year as a 2

digit value if the date is before January 1, 2000).

Use getFullYear instead !! 2.0 3.0 1.0

getHours() Returns the hour as a value between 0 and 23 2.0 3.0 1.0

getMinutes() Returns the minute. (0-59) 2.0 3.0 1.0

getSeconds() Returns the second. (0-59) 2.0 3.0 1.0

getMilliseconds() Returns the millisecond. (0-999) 4.0 4.0 1.0

getTime() Returns the number of milliseconds since 1/1-1970 2.0 3.0 1.0

getTimezoneOffset() Returns the time difference between the

user's computer and GMT 2.0 3.0 1.0

getUTCDate() Returns the date as set by the World Time

Standard, UTC = Universal Coordinated Time.

To return the local time use the getDate method 4.0 4.0 1.0

getUTCDay() Returns the UTC day 4.0 4.0 1.0

getUTCMonth() Returns the UTC month 4.0 4.0 1.0

getUTCFullYear() Returns the UTC 4 digit year 4.0 4.0 1.0

getUTCHourc() Returns the UTC hour 4.0 4.0 1.0

getUTCMinutes() Returns the UTC minutes 4.0 4.0 1.0

getUTCSeconds() Returns the UTC seconds 4.0 4.0 1.0

getUTCMilliseconds() Returns the UTC milliseconds 4.0 4.0 1.0

parse() Returns a string date value into how many

milliseconds since 1/1-1970. 2.0 3.0 1.0

setDate() Sets a new date into the Date object 2.0 3.0 1.0

setFullYear() Sets a new year into the Date object 4.0 4.0 1.0

setHours() Sets a new hour into the Date object. (0-23) 2.0 3.0 1.0

setMilliseconds() Sets new milliseconds into the Date object.

(0-999) 4.0 4.0 1.0

setMinutes() Sets mew minutes hour into the Date object. (0-59) 2.0 3.0 1.0

setMonth() Sets a new month into the Date object. (0-11) 2.0 3.0 1.0

setSeconds() Sets new seconds into the Date object. (0-59) 2.0 3.0 1.0

setTime() Sets milliseconds after 1/1-1970 2.0 3.0 1.0

setYear() Sets a new year into the Date object 2.0 3.0 1.0

setUTCDate() Sets The UTC date 4.0 4.0 1.0

setUTCDay() Sets The UTC date 4.0 4.0 1.0

setUTCMonth() Sets The UTC date 4.0 4.0 1.0

setUTCFullYear() Sets The UTC date 4.0 4.0 1.0

setUTCHourc() Sets The UTC date 4.0 4.0 1.0

setUTCMinutes() Sets The UTC date 4.0 4.0 1.0

setUTCSeconds() Sets The UTC date 4.0 4.0 1.0

setUTCMilliseconds() Sets The UTC date 4.0 4.0 1.0

toGMTString() Returns a string date value. 2.0 3.0 1.0

toLocaleString() Returns a string date value. 2.0 3.0 1.0

toString() Returns a string date value. 2.0 4.0 1.0

The Math object

Properties Explanation NN IE ECMA

E Returns the base of natural logarithms 2.0 3.0 1.0

LN2 Returns the natural logarithm of 2 2.0 3.0 1.0

LN10 Returns the natural logarithm of 10 2.0 3.0 1.0

LOG2E Returns the base-2 logarithm of E 2.0 3.0 1.0

LOG10E Returns the base-10 logarithm of E 2.0 3.0 1.0

PI Returns PI 2.0 3.0 1.0

SQRT1_2 Returns the square root of 0.5 2.0 3.0 1.0

SQRT2 Returns the square root of 2 2.0 3.0 1.0

Methods Explanation NN IE ECMA

abs() Returns the absolute value a number 2.0 3.0 1.0

acos() Returns the arccosine of a number 2.0 3.0 1.0

asin() Returns the arcsine of a number 2.0 3.0 1.0

atan() Returns the arctangent of a number 2.0 3.0 1.0

atan2() Returns the angle from the x axis to a point 2.0 3.0 1.0

ceil() Returns a the nearest whole number greater

than or equal to the number 2.0 3.0 1.0

cos() Returns the cosine of a number 2.0 3.0 1.0

exp() Returns the base of logarithms raised

to a power 2.0 3.0 1.0

floor() Returns a the nearest whole number less

than or equal to the number 2.0 3.0 1.0

log() Returns the logarithm of a number 2.0 3.0 1.0

max() Returns the number with the highest value of

two numbers 2.0 3.0 1.0

min() Returns the number with the lowest value of

two numbers 2.0 3.0 1.0

pow() Returns the value of a base expression taken to

a specified power 2.0 3.0 1.0

random() Returns a random number 2.0 3.0 1.0

round() Returns a number rounded to the nearest whole number 2.0 3.0 1.0

sin() Returns the sine of a number 2.0 3.0 1.0

sqrt() Returns the square root of a number 2.0 3.0 1.0

tan() Returns the tangent of a number 2.0 3.0 1.0

Cheap Web Hosting Articles - Web Site Design & Web Hosting Tutorials - Domain Hosting