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.
constyears=[2011,2012,2013,2014,2015]consteven=years.filter((year)=>year%2===0)console.log(even)