function a() {
var b = [\"b\"];
console.log(b);
//console.log(b.slice());
b = b.push(\"bb\");
}
a();
In a \"perfect\" world you would thin
This is a known problem with console.log.
Instead of turning the parameter into a string when you call the method, the parameter is stored and turned into a string when it's displayed in the UI. As nothing happens in the UI while the function is running, you will see the state of the object as it is when you exit the function.