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

Popular posts from this blog

how to split array as per fixed length, and ionic two dates differences in min,seconds,hours

How to Add Firebase Analytics to Your NativeScript Mobile App