I\'m deeply confused by the behaviour of either JavaScript, or the Chrome console. Can someone help me understand?
Basically I have the following JavaScript code, no
that's because the copied_array is a reference, and console.log is executed asynchonously, so the content of the array is modifed before the first log prints it.
copied_array
you may copy the array before printing
console.log([].concat(copied_array));