Possible Duplicate:
Is Chrome's JavaScript console lazy about evaluating arrays?
I write next js function:
function popFromArray(arr){
console.info(arr);
console.info(arr.pop());
console.info(arr);
}
When I write next code in console I expected next output:
>>> popFromArray([12, 432, 52, 523]);
[12, 432, 52, 523]
523
[12, 432, 52]
But I found strange behaviour for me (chrome and firefox):
>>> q = [12, 432, 52, 523];
>>> popFromArray(q);
[12, 432, 52, 523]
523
[12, 432, 52, 523]
>>> popFromArray(q);
[12, 432, 52]
523
[12, 432, 52]
>>> popFromArray(q);
[12, 432]
52
[12, 432]
Is anybody can explain why it happens?