Hi, if there is an array, is it possible to empty with .remove()
for instance if
A = [1,2,3,4];
how can I empty that.
thanks
Hi, if there is an array, is it possible to empty with .remove()
for instance if
A = [1,2,3,4];
how can I empty that.
thanks
If you need to keep the original array because you have other references to it that should be updated too, you can clear it without creating a new array by setting it's length to zero:
A.length = 0;