javascript filter get index code example
Example 1: filter out arrays js
let newArray = array.filter(function(item) {
return condition;
});
Example 2: js filter items by index
let newArray = arr.filter(callback(element[, index, [array]])[, thisArg])