filter()方法 filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。var words [spray, limit, elite, exuberant, destruction, present]; const result words.filter(function(item, index, array){ return item.length 6 }); console.log(result); //[exuberant, destruction, present]