javascript + delete item from array code example
Example 1: js delete all from array
var list = [1, 2, 3, 4];
function empty() {
//empty your array
list.length = 0;
}
empty();
Example 2: exclude vales from array in js
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
var filtered = array.filter(function(value, index, arr){
return value > 5;
});
//array => [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
//filtered => [6, 7, 8, 9]