Java Reference
In-Depth Information
Methods
Method
Introduced
Description
apply(thisObj,
arguments)
JavaScript 1.3
Calls a function or method as if it belonged to thisObj
and passes arguments to the function or method.
arguments must be an array.
call(thisObj,
arg1, …)
JavaScript 1.3
Identical to apply(), except arguments are passed indi-
vidually instead of in an array.
toString()
JavaScript 1.1
Converts the Function object into a string.
valueOf()
JavaScript 1.1
Returns the primitive value of the Function object.
Math
The Math object provides methods and properties used for mathematical calculations. Introduced in
JavaScript 1.0, the Math object is a top-level object, which can be accessed without a constructor.
Properties
Property
Introduced
Description
E
JavaScript 1.0
Returns Euler's constant (the base of natural logarithms;
approximately 2.718).
LN10
JavaScript 1.0
Returns the natural logarithm of 10 (approximately 2.302).
LN2
JavaScript 1.0
Returns the natural logarithm of 2 (approximately 0.693).
LOG10E
JavaScript 1.0
Returns the base 10 logarithm of E (approximately 0.434).
LOG2E
JavaScript 1.0
Returns the base 2 logarithm of E (approximately 1.442).
PI
JavaScript 1.0
Returns pi, the ratio of the circumference of a circle to its diameter
(approximately 3.142).
SQRT1_2
JavaScript 1.0
Returns the square root of 1/2 (approximately 0.707).
SQRT2
JavaScript 1.0
Returns the square root of 2 (approximately 1.414).
Methods
Method
Introduced
Description
abs(x)
JavaScript 1.0
Returns the absolute (positive) value of a number.
acos(x)
JavaScript 1.0
Returns the arccosine of a number (in radians).
asin(x)
JavaScript 1.0
Returns the arcsine of a number (in radians).
Continued
Search WWH ::




Custom Search