Web design - N Number.valueOf() (Method) Cross-references: ECMA 262 edition

N Number.valueOf() (Method) Cross-references: ECMA 262 edition 2 section 15.7.4.2 ECMA 262 edition 3 section 15.7.4.2 Number.valueOf() (Method) Return the primitive numeric value of the object. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 3.0 Internet Explorer 4.0 Netscape 3.0 Property/method value type: Number primitive JavaScript syntax: -myNumber.valueOf() A Numberobject is converted to a simple Number primitive. You probably won’t need to do this very often yourself because JavaScript is smart enough to convert Number primitives to Number objects and vice versa whenever it needs to. This is a whole lot better than having to cast data types to get expressions to work, as you would have to in other programming languages. This help makes JavaScript very accessible to non-programmers. See also: Cast operator, Number.prototype, valueOf() Cross-references: ECMA 262 edition 2 section 15.7.4.3 ECMA 262 edition 3 section 15.7.4.4 Numeric literal (Primitive value) A literal constant whose type is a built-in primitive value. Availability: ECMAScript edition 2 Property/method value type: Number primitive Numeric literals are constant numeric values expressed in Decimal, Hexadecimal, or Octal notation. Numeric values can be integer or floating-point. Floating-point values can be specified with exponential notation. 1565

Leave a Reply