4 ms·
Point 7 is wrong. Example: a = {k: 10}; b = {k: 20}; var fn = function () {with (a) {this.k = 30;}}; fn.call(b); console.log("a.k: ", a.k); // 10 console
by v413 14y ago
Point 7 is wrong.
Example:
a = {k: 10};
b = {k: 20};
var fn = function () {with (a) {this.k = 30;}};
fn.call(b);
console.log("a.k: ", a.k); // 10
console.log("b.k: ", b.k); // 30
- jpolitz 14y agoThanks, not sure what I was smoking there. I can't seem to go back and edit, though...