Slide 15
Slide 15 text
var func = function () {
console.log('exec');
return {
valueOf: function valueOf() {
console.log("valueOf");
return {}; // not a primitive
},
toString: function toString() {
console.log("toString");
return {}; // not a primitive
}
};
};
func() + 1;
// exec
// valueOf
// toString
// error