In JavaScript, the .filter()
method allows you to create a new array by returning the elements of a given array that pass a test implemented by the function you provide.
const years = [2011, 2012, 2013, 2014, 2015]
const even = years.filter((year) => year % 2 === 0)
console.log(even)