array in the console
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
People
(Reporter: montdm, Unassigned)
Details
Attachments
(1 file)
(deleted),
image/jpeg
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
in javascript, I put console.log (myvar)
where mywar is an array quite big
the javascript go on, myvar changes (using splice) and I put another console.log(myvar)
Actual results:
I open the console and look at the prints :
the first array (at the first console.log) is not all visible (I can see then 10 first values), but I can see the array's length is 12 and 4 for the second one (8 were array.splice).
I open the first array with the small triangle : the array's length is 4 and is the same that at the second console.log !
I close the array with the small triangle : the array's length is 12 !
In the file, you can see the var : at the top when the array is closed and at the bottom when the array is opened
Expected results:
when I open the array, i would like to see the var at the time it was print in the console but I see the var at the end of execution of javascript. Looks like the console had lost the memory of the content of the var
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•5 years ago
|
||
Thanks for filing the issue.
This is a known issue.
A workaround would be to log a new array console.log(JSON.parse(JSON.stringify(myvar)))
so it's not affected by later alterations on myvar
.
Description
•