Closed Bug 1588308 Opened 5 years ago Closed 5 years ago

array in the console

Categories

(DevTools :: Console, defect)

69 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1505304

People

(Reporter: montdm, Unassigned)

Details

Attachments

(1 file)

Attached image bug array console.jpg (deleted) —

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

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Console
Product: Firefox → DevTools

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.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: