There are currently four built in types of objects in JavaScript
-
Date, Math , string (one object each -- string is lower case s) plus a whole bunch connected with HTML documents
|
Math has a set of properties(built in constants) including
|
E LN10 LN2 PI SQRT1_2 SQRT2 so that
|
Math.PI = 3.14159 etc.
|
Math methods include the usual ones in Fortran Intrinsic library with examples
|
Math.random() returns pseudo random number between 0 and 1
|
Math.abs(x) returns absolute value of x
|
Math.max(x1,x2) returns maximum of two numbers x1 and x2
|
Math.cos(x) returns cosine of argument x in radians
|
Math.round(x) rounds x to nearest positive or negative integer
|