Why would setting the length of an array to 0 make it holey? I would understand if you were to set the length to a value greater than its content, it would create a HOLEY_ELEMENTS. Truncating should not have that same problem.
I would think the engine would continue to optimize for a PACKED_ELEMENTS Array if length were set to a value less than its current content, including 0.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why would setting the length of an array to
0
make itholey
? I would understand if you were to set the length to a value greater than its content, it would create aHOLEY_ELEMENTS
. Truncating should not have that same problem.I would think the engine would continue to optimize for a
PACKED_ELEMENTS
Array if length were set to a value less than its current content, including0
.