Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var SomeObject = function(a, b){
- this.a = a;
- this.b = b
- }
- SomeObject.prototype.toString = function(){
- return [ this.a, this.b ].join(' ')
- }
- var objInstance = new SomeObject('this', 'that');
- console.log(objInstance + '') // this that
- console.log(("" + objInstance).split('')) // [ 't', 'h', 'i', 's', ' ', 't', 'h', 'a', 't' ]
- console.log(objInstance.split()) // error
Add Comment
Please, Sign In to add comment