var arr1=[1,2,3];
var arr2=[2,5];
var newArr =arr1.filter(function(item){
return arr2.indexOf(item) != -1
});
console.log(newArr) ----- 返回值 [2]
var arr1=[1,2,3];
var arr2=[2,5];
var newArr =arr1.filter(function(item){
return arr2.indexOf(item) != -1
});
console.log(newArr) ----- 返回值 [2]