JSFiddle - React, Tailwind, and code Playground
by Chace
TypeScript
const itemsOrig = [{
text: "Learn JavaScript",
done: false
},
{
text: "Learn React",
done: false
},
{
text: "Play around in JSFiddle",
done: true
},
{
text: "Build something awesome",
done: true
}
]
const itemsNew = [{
text: "Learn JavaScript",
done: false
},
{
text: "Learn React",
done: false
},
{
text: "Play around in JSFiddle",
done: true
},
{
text: "Build something awesome",
done: true
},
{
text: "Fart",
done: true
},
{
text: "Farted",
done: true
}
]
const findNewValues = (origArray,newArray) => {
return newArray.filter(object1 => {
return !origArray.some(object2 => {
return object1.text === object2.text;
});
});
}
console.log(findNewValues(itemsOrig, itemsNew));