While exploring Chrome DevTools, I came across an inconsistency that caught my attention.
The screenshot above shows the issue I encountered. Initially, it indicated that the object contained a Body
and a Head
, with the head being an array of length 1
. However, upon expanding the array, its length suddenly changed to 2
.
Upon further examination of the expanded array, I discovered an empty string within it. This empty string was causing complications in my code, prompting me to investigate further.
My main focus is on the DevTools output – does anyone know why DevTools would show two different lengths for the same array?
Could it be possible that DevTools automatically interprets the content of an array of length one as a separate variable? In such a case, I would have expected Head: [Array[2]]
.
I used console.log
to display the information shown in the screenshot above, using Chrome DevTools on an Ubuntu VirtualBox setup.