4.4 Example of Precedence var a = 2, b = 4, c, d; c = 3 + a * b; // * is first, so c is now 11 (not 24) d = b / a / 2; // / associates left, so d is now 1 (not 4) The Math Object Provides a collection of properties and methods useful for Number values This includes the trigonometric functions such as sin and cos When used, the methods must be qualified, as in Math.sin(x) The Number Object Properties MAX_VALUE MIN_VALUE NaN POSITIVE_INFINITY NEGATIVE_INFINITY PI Operations resulting in errors return NaN Use isNaN(a) to test if a is NaN toString method converts a number to string String Catenation The operation + is the string catenation operation
methods useful for Number values 4.4 Example of Precedence var a = 2, b = 4, c, d; c = 3 + a * b; // * is first, so c is now 11 (not 24) d = b / a / 2; // / associates left, so d is now 1 (not 4) The Math Object Provides a collection of properties and This includes the trigonometric functions such as sin and cos When used, the methods must be qualified, as in Math.sin(x) The Number Object Properties MAX_VALUE MIN_VALUE NaN POSITIVE_INFINITY NEGATIVE_INFINITY PI Operations resulting in errors return NaN Use isNaN(a) to test if a is NaN toString method converts a number to string String Catenation The operation + is the string catenation operation
10cs73.docx