JavaScript


Array Object Methods
Method                      Description

concat()                      Joins two or more arrays, and returns a copy of the joined arrays
indexOf()                    
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


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


Object Methods
alt                                Sets or returns the value of the alt attribute of an area        Yes
coords                         Sets or returns the value of the coords attribute of an area Yes
hash                            Sets or returns the anchor part of the href attribute value   Yes
host                             Sets or returns the hostname:port part of the href attribute value  Yes
hostname                   Sets or returns the hostname part of the href attribute value          Yes
href                             Sets or returns the value of the href attribute of an area     Yes
noHref                        Sets or returns the value of the nohref attribute of an area Yes
pathname                   Sets or returns the pathname part of the href attribute value          Yes
port                             Sets or returns the port part of the href attribute value       Yes
protocol                     Sets or returns the protocol part of the href attribute value Yes
search                         Sets or returns the querystring part of the href attribute value        Yes
shape                          Sets or returns the value of the shape attribute of an area  Yes
target                          Sets or returns the value of the target attribute of an area  Yes

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 Jan 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)
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 midnight of January 1, 1970, according to universal time
valueOf()                    Returns the primitive value of a Date 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

String Object Methods
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 between a regular expression and a string, and returns the matches
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
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, and through the specified number of character
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.
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

Number Object

The Number object is an object wrapper for primitive numeric values.

Number objects are created with new Number().
Syntax
 var num = new Number(value);

Note: If the value parameter cannot be converted into a number, it returns NaN (Not-a-Number).
Number Object Properties
Property                      Description
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 into an exponential notation
toFixed(x)                    Formats a number with x numbers of digits after the decimal point
toPrecision(x)              Formats a number to x length
toString()                     Converts a Number object to a string
valueOf()                     Returns the primitive value of a Number object


Modifiers are used to perform case-insensitive and global searches:
Modifier                     Description
i                                   Perform case-insensitive matching
                                 Perform a global match (find all matches rather than stopping after the first match)
m                                 Perform multiline matching

No comments:

Post a Comment