Suchergebnisse für Anfrage "prototype-programming"

4 die antwort

Warum ruft das Boolesche Primitiv den Prototyp nicht toString () auf?

Sag ich habe diesen Code: Boolean.prototype.toString = function toString() { return this.valueOf() ? '1' : '0'; }; var object = { true: 'true', false: 'false', 1: '1', 0: '0' }; // "true" - this doesn't work console.log('primitive', ...

TOP-Veröffentlichungen