The great thing with console.dir (at least in Chrome, judging by my experience, and this ) is that the extension evaluates and displays the current value of the object at the moment you are executing the extension, not the ones that are at the moment calling console.dir() .
See for example
<html><body> open/refresh this with the javascript console open <script> var ar = new Float32Array(1); ar[0]=2; console.log(ar[0]); console.dir(ar); ar[0]=200; </script>
When you expand the array in the console, you see a value of 200.
It should not be a mistake, and this is certainly a performance thing (an object can be very large), but the behavior is strange and potentially confusing.
In addition, I tested this, if after that the value changes, the console does not update it (therefore, it does not work like the "watch" window in the debugger).
leonbloy
source share