cara menghapus array dalam javascript
A.length = 0
Ugly Unicorn
A.length = 0
let list = [1, 2, 3, 4];
function empty() {
//empty your array
list.length = 0;
}
empty();
// define Array
let list = [1, 2, 3, 4];
function empty() {
//empty your array
list = [];
}
empty();
var list = [1, 2, 3, 4];
function empty() {
//empty your array
list.length = 0;
}
empty();