
描述: 在右側val(selectBranchIdList)中不存在的資料删除掉
item為左側資料
let saveId = [];
for (let index = _this.selectBranchIdList.length - 1; index >= 0 ; index--) {
_this.teamIds.filter(function(item, second, array){
if(item.indexOf(_this.selectBranchIdList[index]) !== -1 ){
saveId.push(item);
}
});
}
indexOf傳回所查找字元串位置,找不到傳回-1