4 ms·
Perhaps - I think a lesson to be taken though is to be careful about trusting console.log. It threw me into a loop when I first encountered it.
by Bahamut 13y ago
Perhaps - I think a lesson to be taken though is to be careful about trusting console.log. It threw me into a loop when I first encountered it.
- eof 13y agoAgreed, 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