Random function; Moth.random ()
// 3, the following through the loop to each element of the array assignment, random number. // math.random (); Can randomly 0~1 any number between [0,1] // alert (Math.random ()); /* integer between Random 0~10 (can be random to 0 but not at random), parseint (Math.random ( ) *) * /
Math.Abs (required value) to find absolute values
Math.max (x, Y, z) The maximum value can be multi-valued (only two values before JS3).
Math.min (x, Y, Z ...) to find the minimum value can be multi-valued (only two values before JS3).
Examples are as follows:
//Math.Abs (required value) to find absolute valuesAlert (Math.Abs (100));// -Alert (Math.Abs (-100));// -Alert (Math.Abs (100-300));// $/*----------------------------------------------------------------*/ //Math.max (x, Y, z) The maximum value can be multi-valued (only two values before JS3). Alert (Math.max (100, 300, 200));// $Alert (Math.max (-100,-110));//-100Alert (Math.max (-100,-100));//-100/*---------------------------------------------------------*/ //math.min (x, Y, Z ...) to find the minimum value can be multi-valued (only two values before JS3). Alert (math.min (100, 300, 200)); Alert (Math.min (-100,-110));//-100Alert (math.min (-100,-100));//-100
The JS function for math arithmetic