If one array is assigned to another array, why is one less in the new array?

the original array looks like this:

clipboard.png

:

clipboard.png

Mar.21,2021

when running console.log (arr), chrome prints out the length of the array, that is, "6", because the argument is an array.

then you changed the array, now there are only five elements, but chrome will not take the initiative to change the printed "6" to "5", all the printed results will not change.

when you expand this array, you are looking at the latest information, so it is "5".

the implication is that you changed the array after console, but you don't know how to change it until you put it in the code.


the answer upstairs is not quite right, at least it doesn't fit all the circumstances

I guess the problem is that the assignment does not trigger the recalculation of the array in the frame. If it is a vue framework, you can use the this.$set () method to recalculate it

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea01bc-1aab.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea01bc-1aab.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?