2
I was running some tests on javascript and I realized that when I use the function delete in an index of a array, the array is still the same size.
Example:
a = [1, 2, 3]
delete a[1]
console.log(a.length); // Imprime 3
Why does this happen?
The
deleteonly removes the assigned value. It is a question of data structure. Aarrayis a limited and fixed sequence of memory lained positions. If you want to manipulate a list you must use a chained list, not natively present in Javascript.– MFedatto