arrays
// remove same data from two arrays
const array1 = this.Productsforcompare;
const array2 = this.Productsnewcompare2;
const array3 = array1.filter(entry1 => !array2.some(entry2 => entry1.ProductID === entry2.ProductId));
console.log(array3);
// end remove same data from two arrays
// remove single id based remove data from array
const items = JSON.parse(localStorage.getItem('outbounddatasavedlocal'));
const filtered = items.filter(item => item.OutboundId !== this.removeouterid);
localStorage.setItem('outbounddatasavedlocal', JSON.stringify(filtered));
Comments
Post a Comment