how to filter data in array javascript code example
Example: filter an array in Javascript
1let greaterTen = [];2
3for (let i = 0; i<numbers.length; i++) {4 var currentNumber = numbers[i];5 if (currentNumber > 10) {6 greaterTen.push(currentNumber)7 }8}9
10console.log(greaterTen); // [23, 12, 45, 78, 11, 10.1, 84]