Created
May 30, 2014 16:58
-
-
Save koron/2a2e262052f1de865708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boolean.prototype.toString = function() { return 'foo'; } | |
console.log(false); | |
console.log(false.toString()); | |
console.log('' + false) | |
function Bar() {} | |
Bar.prototype.toString = function() { return 'bar'; } | |
var b = new Bar(); | |
console.log(b); | |
console.log(b.toString()); | |
console.log('' + b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ECMAScript の仕様 9.8 ToString によるものと判明した。