4 ms·
That's... what asynchronous means. The call to console.log() will return before the console output is actually produced.
by metafunctor 5y ago
That's... what asynchronous means. The call to console.log() will return before the console output is actually produced.
- MatthewMob 5y agoNo. It means that when you invoke `console.log` in a browser it "logs" a reference to an object instead of serialising it. This log is still synchronous, but when you expand it in the console its properties are dereferenced and may be different from when the original log was made. The log, however, is still instantaneous and synchronous.
- metafunctor 5y agoOK, agreed. That's an important distinction. The console log will synchronously receive a reference to an object; later if you expand something in the log window it shows you the current state.
- mjbrusso 5y agoI would say the argument is lazy evaluated.
- genezeta 5y agoTo add to the MatthewMob's explanation, see this: https://imgur.com/a/vUTCumu https://imgur.com/a/vUTCumu
- voiper1 5y agoThanks! I figured it meant that, but nice to see it without having to mess around.