And till now, I still don’t like it LOL
But because of my job, I have to deal with this it :)
1. Do not use new Array()
Please use  instead of the built-in constructor new Array().
The two statements below both create an empty array:
The two statements below both create an array that contains 5 numbers:
The reason we abandon the built-in constructor new Array() is that It makes your code complex and can cause nasty side effects.
|If you want to change the comma to any other character like *,||, -,… use join() method:|
3. Remove Array Element by Index
To remove an Array Element by index, we use splice() method:
4. Remove Array Element by Value
The below code snippet describe a function within Array class that allows you to remove an array element by an input value:
The most common way we use to empty an arry is:
This way can clear all data of cities array but it can lead to some reference problems!
So, to empty an array correctly withou causing any side effects, just set the array length to 0! Simple, huh? :)