3 ms·
They didn't write that, they wrote this: function doThing(target) { function run() { console.log(myVar); } const myVar = target.prop; run(); }
by Izkata 7y ago
They didn't write that, they wrote this:
function doThing(target) {
function run() { console.log(myVar); }
const myVar = target.prop;
run();
}
The console.log's evaluation is delayed, so it's totally valid.