js delete all from array

Solutions on MaxInterview for js delete all from array by the best coders in the world

showing results for - "js delete all from array"
Paula
06 Sep 2016
1var list = [1, 2, 3, 4];
2function empty() {
3    //empty your array
4    list.length = 0;
5}
6empty();
7