If I have
var foo = function() {
console.log('foo');
}, bar = foo;
and call bar()
, the console logs foo
. If then, I do
foo = function() {
console.log('not foo');
}
and call bar()
, the console still logs foo
. How can I get around this?
what you're trying to do is not very wise, but i'll hand you the shotgun, blast off! (your legs i mean.)
var foo = function () { console.log("foo"); }
var bar = function () { foo(); }
bar();
var foo = function () { console.log("qux"); }
bar();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments