I’m asking little naive question, but I’m seriously I’m not sure how to convert this for loops
const filteredData = csiList.filter(item => {
for (var i = 0, len = this.tableData.length; i < len; i++) {
if (this.tableData[i].csiId == item.appId) {
return false;
}
}
return true;
})
If some one can quickly show how this loops are/is written in more next gen JS ES6/ES7 way, would be of great help
>Solution :
const filteredData = csiList.filter(item => !this.tableData.some(tableDataItem => tableDataItem.csiId === item.appId));