1arr = []; // set array=[]
2
3//function
4const empty = arr => arr.length = 0;
5//example
6var arr= [1,2,3,4,5];
7empty(arr) // arr=[]
1if (array === undefined || array.length == 0) {
2 // array empty or does not exist
3}
1// Variable array for a wider scope:
2var arrayName = [];
3// Local scope variable array:
4let arrayName = [];