JavaScript
Result
Run
License
window.addEventListener("load", function() { function MyString(str) { // 내부적으로 valueOf() 메소드 호출 this.str = str; } // valueOf() 메소드 재정의 MyString.prototype.valueOf = function() { return this.str; } var myObj = new MyString("Hello"); document.body.textContent = myObj + ", JavaScript!"; });
Console
expand_less
License
License
by DevDic
Close