Specifications

Sets the seconds to the specified seconds, which must be in the
range 0..59, in local time. The milliseconds past the seconds
(optMilliseconds) can also be specified.
var d = new Date( 1975, 12, 25, 22, 30 );
d.setSeconds( 25 ); // d == 1980-12-30T22:30:25
setSeconds( seconds :
Number, optMilliseconds
: Number )
Sets the date and time to the local date and time given in terms of
milliseconds since midnight on the 1st January 1970.
var d = new Date( 1975, 12, 25, 22, 30 );
setTime( milliseconds :
Number )
var duplicate = new Date();
duplicate.setTime( d.getTime() );
Converts the date into a string on the ISO 8601 extended format:
YYYY-MM-DDTHH:MM:SS.
var d = new Date( 1975, 12, 25, 22, 30 );
var s = d.toString(); // s == "1975-12-25T22:30:00"
toString( ) : String
Function
In some situations it is desirable to create functions at run time.
var min = new Function( "x", "y", "return x < y ? x : y;" );
var m = min( 68, 9 ); // m == 9
The first arguments are the names of the parameters; the last argument is a string which contains
the function's definition. It is also possible to supply the list of argument names as one comma
separated string.
var min = new Function( "x,y", "return x < y ? x : y;" );
Variable numbers of arguments are also supported using the arguments array (see built-in
variables). For example:
var max = new Function(
"var max = 0;"
+ "for ( var i = 0; i < arguments.length; i++ ) {"
+ " if ( arguments[ i ] > max ) max = arguments[ i ];"
+ "}"
+ "return max;"
);
var x = max( 50, 16, 24, 99, 1, 97 ); // x == 99
Number
A Number is a datatype that represents a number. In most situations, programmers will use
numeric literals like 3.142 directly in code. The Number datatype is useful for obtaining system
limits, example: MIN_VALUE and MAX_VALUE, and for performing number to string conversions
with toString()
A numeric variable can hold a non-numeric value, in which case isNaN() returns true. The result
of an arithmetic expression may exceed the maximum or minimum representable values in which
case the value of the expression will be Infinity, and isFinite() will return false. See also built-in
contants and built-in functions.
378
Enfocus Switch 10