Definitions for "ValueOf"
JavaScript method built into every object type, and automatically invoked when JavaScript encountering an object where a primitive value is expected. If an object has no primitive value, valueOf returns the object itself. The following object types are those for which the valueOf method is most useful. Most other objects have no primitive value. Number; Boolean; String; Function - e.g. typeof funObj returns "object", but typeof funObj.valueOf() returns "function". The default valueOf method can be overridden (takes no arguments). e.g. myNumberType.prototype.valueOf = new Function(functionText) See String and parseInt and Number.