5 ms·
Agreed, I was pulling hair out of my head--convinced for a moment there was no order in the universe until I realized that console.log could time travel. It ap
by eof 13y ago
Agreed, I was pulling hair out of my head--convinced for a moment there was no order in the universe until I realized that console.log could time travel.
It appears to me that webkit's logging by reference is actually fuzzy; after some magical amount of time the logged object will be displayed "how it used to be"; but in some cases like
obj = {foo: 'something bad mwahahhaa'};
console.log(obj);
obj.foo = 'something good ;-)';
it will just go ahead and time travel to 'something good' and you will never see the 'something bad'.
however, if you expand the the object in the console (side note, would be nice to have an option to display expanded by default) it doesn't ever time travel and
obj = {foo: 'something bad mwahahhaa'};
console.log(obj);
// some magic amount of time or lines of execution
obj.foo = 'something good ;-)';
will also not time travel