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.

functions

Summary

The following table lists JavaScript functions.

Syntax

Functions

FunctionDescriptionJavaScript object
abs FunctionReturns the absolute value of a number.Math
acos FunctionReturns the arccosine of a number.Math
asin FunctionReturns the arcsine of a number.Math
atan FunctionReturns the arctangent of a number.Math
atan2 FunctionReturns the angle (in radians) from the X axis to a point (y,x).Math
ceil FunctionReturns the smallest integer greater than or equal to its numeric argument.Math
cos FunctionReturns the cosine of a number.Math
create FunctionCreates an object that has a specified prototype, and that optionally contains specified properties.Object
decodeURI FunctionReturns the unencoded version of an encoded Uniform Resource Identifier.Global
decodeURIComponent FunctionReturns the unencoded version of an encoded component of a Uniform Resource Identifier.Global
defineProperties FunctionAdds one or more properties to an object, and/or modifies attributes of existing properties.Object
defineProperty FunctionAdds a property to an object, or modifies attributes of an existing property.Object
encodeURI FunctionEncodes a text string as a valid Uniform Resource Identifier.Global
encodeURIComponent FunctionEncodes a text string as a valid component of a Uniform Resource Identifier.Global
escape FunctionEncodes String objects so they can be read on all computers.Global
eval FunctionEvaluates JavaScript code and executes it.Global
exp FunctionReturns e (the base of natural logarithms) raised to a power.Math
floor FunctionReturns the greatest integer less than or equal to its numeric argument.Math
freeze FunctionPrevents the modification of existing property attributes and values, and prevents the addition of new properties.Object
fromCharCode FunctionReturns a string from a number of Unicode character values.String
getOwnPropertyDescriptor FunctionReturns the definition of a data property or an accessor property.Object
getOwnPropertyNames FunctionReturns the names of the properties and methods of an object.Object
getPrototypeOf FunctionReturns the prototype of an object.Object
isArray FunctionReturns a Boolean value that indicates whether an object is an array.Array
isExtensible FunctionReturns a value that indicates whether new properties can be added to an object.Object
isFinite FunctionReturns a Boolean value that indicates if a supplied number is finite.Global
isFrozen FunctionReturns true if existing property attributes and values cannot be modified in an object and new properties cannot be added to the object.Object
isNaN FunctionReturns a Boolean value that indicates whether a value is the reserved value NaN (not a number).Global
isSealed FunctionReturns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.Object
keys FunctionReturns the names of the enumerable properties and methods of an object.Object
log FunctionReturns the natural logarithm of a number.Math
max FunctionReturns the greater of two supplied numeric expressions.Math
min FunctionReturns the lesser of two supplied numbers.Math
now FunctionReturns the number of milliseconds between January 1, 1970, and the current date and time.Date
parse Function (Date)Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.Date
parse Function (JSON)De-serializes JSON text to produce an in-memory object or array.JSON
parseFloat FunctionReturns a floating-point number converted from a string.Global
parseInt FunctionReturns an integer converted from a string.Global
pow FunctionReturns the value of a base expression raised to a specified power.Math
preventExtensions FunctionPrevents the addition of new properties to an object.Object
random FunctionReturns a pseudorandom number between 0 and 1.Math
round FunctionReturns a specified numeric expression rounded to the nearest integer.Math
seal FunctionPrevents the modification of attributes of existing properties, and prevents the addition of new properties.Object
sin FunctionReturns the sine of a number.Math
sqrt FunctionReturns the square root of a number.Math
stringify FunctionSerializes an object or array into JavaScript Object Notation (JSON) text.JSON
tan FunctionReturns the tangent of a number.Math
unescape FunctionDecodes String objects encoded with the escape method.Global
UTC FunctionReturns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the supplied date.Date

See also

Other articles

Attributions

  • Microsoft Developer Network: Article