This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

methods

Summary

The following table lists JavaScript methods.

Syntax

Methods

MethodDescriptionJavaScript object
anchorPlaces an HTML anchor that has a NAME attribute around text.String
applyApplies a method of an object, substituting another object for the current object.Function
bigPlaces HTML <BIG> tags around text.String
bindCreates a function that is associated with a specified object, and that can have specific initial parameters.Function
blinkPlaces HTML <BLINK> tags around text.String
boldPlaces HTML <B> tags around text.String
callCalls a method of an object, substituting another object for the current object.Function
charAtReturns the character at the specified index.String
charCodeAtReturns the Unicode encoding of the specified character.String
compileCompiles a regular expression into an internal format.Regular Expression
concatReturns a new array consisting of a combination of two arrays.Array
concatReturns a String object containing the concatenation of two supplied strings.String
everyChecks whether a defined callback function returns true for all elements in an array.Array
execExecutes a search for a match in a specified string.Regular Expression
filterCalls a defined callback function on each element of an array, and returns an array of values for which the callback function returns true.Array
fixedPlaces HTML <TT> tags around text.String
fontcolorPlaces HTML <FONT> tags with a COLOR attribute around text.String
fontsizePlaces HTML <FONT> tags with a SIZE attribute around text.String
forEachCalls a defined callback function for each element in an array.Array
getDateReturns the day-of-the-month value using local time.Date
getDayReturns the day-of-the-week value using local time.Date
getFullYearReturns the year value using local time.Date
getHoursReturns the hours value using local time.Date
getMillisecondsReturns the milliseconds value using local time.Date
getMinutesReturns the minutes value using local time.Date
getMonthReturns the month value using local time.Date
getSecondsReturns seconds value using local time.Date
getTimeReturns the time value in a Date Object as the number of milliseconds since midnight January 1, 1970.Date
getTimezoneOffsetReturns the difference in minutes between the time on the host computer and Universal Coordinated Time (UTC).Date
getUTCDateReturns the day-of-the-month value using UTC.Date
getUTCDayReturns the day-of-the-week value using UTC.Date
getUTCFullYearReturns the year value using UTC.Date
getUTCHoursReturns the hours value using UTC.Date
getUTCMillisecondsReturns the milliseconds value using UTC.Date
getUTCMinutesReturns the minutes value using UTC.Date
getUTCMonthReturns the month value using UTC.Date
getUTCSecondsReturns the seconds value using UTC.Date
getYearReturns the year value .Date
hasOwnPropertyReturns a Boolean value that indicates whether an object has a property with the specified name.Multiple
indexOfReturns the index of the first occurrence of a value in an array.Array
indexOfReturns the character position where the first occurrence of a substring occurs within a String object.String
isPrototypeOfReturns a Boolean value that indicates whether an object exists in another object’s prototype chain.Multiple
italicsPlaces HTML <I> tags around text.String
joinReturns a String object consisting of all the elements of an array concatenated together.Array
lastIndexOfReturns the index of the last occurrence of a specified value in an array.Array
lastIndexOfReturns the last occurrence of a substring within a String object.String
linkPlaces an HTML anchor that has an HREF attribute around text.String
localeCompareReturns a value indicating whether two strings are equivalent in the current locale.String
mapCalls a defined callback function on each element of an array, and returns an array that contains the results.Array
matchReturns, as an array, the results of a search on a string using a supplied Regular Expression object.String
popRemoves the last element from an array and returns it.Array
propertyIsEnumerableReturns a Boolean value that indicates whether a specified property is part of an object and whether it is enumerable.Multiple
pushAppends new elements to an array, and returns the new length of the array.Array
reduceAccumulates a single result by calling a defined callback function for all elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.Array
reduceRightAccumulates a single result by calling a defined callback function for all elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.Array
replaceReturns a copy of a string with text replaced using a regular expression.String
reverseReturns an Array object with the elements reversed.Array
searchReturns the position of the first substring match in a regular expression search.String
setDateSets the numeric day of the month using local time.Date
setFullYearSets the year value using local time.Date
setHoursSets the hours value using local time.Date
setMillisecondsSets the milliseconds value using local time.Date
setMinutesSets the minutes value using local time.Date
setMonthSets the month value using local time.Date
setSecondsSets the seconds value using local time.Date
setTimeSets the date and time value in the Date object.Date
setUTCDateSets the numeric day of the month using UTC.Date
setUTCFullYearSets the year value using UTC.Date
setUTCHoursSets the hours value using UTC.Date
setUTCMillisecondsSets the milliseconds value using UTC.Date
setUTCMinutesSets the minutes value using UTC.Date
setUTCMonthSets the month value using UTC.Date
setUTCSecondsSets the seconds value using UTC.Date
setYearSets the year value using local time.Date
shiftRemoves the first element from an array and returns it.Array
sliceReturns a section of an array.Array
sliceReturns a section of a string.String
smallPlaces HTML <SMALL> tags around text.String
someChecks whether a defined callback function returns true for any element of an array.Array
sortReturns an Array object with the elements sorted.Array
spliceRemoves elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.Array
splitReturns the array of strings that results when a string is separated into substrings.String
strikePlaces HTML <STRIKE> tags around text.String
subPlaces HTML <SUB> tags around text.String
substrReturns a substring beginning at a specified location and having a specified length.String
substringReturns the substring at a specified location within a String object.String
supPlaces HTML <SUP> tags around text.String
testReturns a Boolean value that indicates whether or not a pattern exists in a searched string.Regular Expression
toDateStringReturns a date as a string value.Date
toExponentialReturns a string containing a number represented in exponential notation.Number
toFixedReturns a string representing a number in fixed-point notation.Number
toGMTStringReturns a date converted to a string using Greenwich Mean Time (GMT).Date
toISOStringReturns a date as a string value in ISO format.Date
toJSONUsed to transform data of an object type before the JSON serialization.Date
toLocaleDateStringReturns a date as a string value appropriate to the host environment’s current locale.Date
toLocaleLowerCaseReturns a string where all alphabetic characters have been converted to lowercase, taking into account the host environment’s current locale.String
toLocaleStringReturns an object converted to a string using the current locale.Multiple
toLocaleTimeStringReturns a time as a string value appropriate to the host environment’s current locale.Date
toLocaleUpperCaseReturns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment’s current locale.String
toLowerCaseReturns a string where all alphabetic characters have been converted to lowercase.String
toPrecisionReturns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.Number
toStringReturns a string representation of an object.Multiple
toTimeStringReturns a time as a string value.Date
toUpperCaseReturns a string where all alphabetic characters have been converted to uppercase.String
toUTCStringReturns a date converted to a string using UTC.Date
trimReturns a string with leading and trailing white space and line terminator characters removed.String
unshiftInserts new elements at the start of an array.Array
valueOfReturns the primitive value of the specified object.Multiple

See also

Other articles

Attributions

  • Microsoft Developer Network: Article