In Google Chrome the following snippet
var array = [{a: 0}];
console.log(array);
array[0].a = 1;
outputs [{a: 1}]
(It doesn't when using Stackoverflow Snippet, but check it out on JsFiddle)
I suspect this is because console.log
is asynchronously implemented in Chrome and the array is stored by reference. I have noticed that console.table()
works fine this way.
Is there any way to make console.log()
do the same?