//using filter() method => it returns a new array data = [1, 2, 3, 4, 5, 6]; let filteredData = data.filter((i) => { return i > 2 }); console.log(filteredData) // [3, 4, 5, 6]