Almost every object inherits from Object.prototype. constructor points to the creating function. JavaScript calls valueOf() when an object is used as a number and toString() when it is used as a string, so overriding them customizes conversion. hasOwnProperty(), isPrototypeOf() and propertyIsEnumerable() test keys and chains, and Object.prototype.toString.call(x) gives a reliable type tag. The legacy __proto__ accessor is deprecated: use Object.getPrototypeOf().
function Money(cents) { this.cents = cents; }
Money.prototype.valueOf = function () { return this.cents / 100; };
Money.prototype.toString = function () { return `$${this.valueOf().toFixed(2)}`; };
const m = new Money(250);
console.log(m + 1, `${m}`, m.constructor === Money, m.hasOwnProperty("valueOf"));
console.log(Money.prototype.isPrototypeOf(m), Object.prototype.toString.call(null));3.5 $2.50 true false true [object Null]