Dan93
0
Q:

how to make array empty

var colors = ["red","blue","green"];
    colors = []; //empty the array
9
let list = [1, 2, 3, 4];
function empty() {
    //empty your array
    list.length = 0;
}
empty();
0
const colors = ["red","blue","green"];
colors.lenght = 0;
-2

New to Communities?

Join the community