I want the differences between the two arrays. The result I'm seeking for this example would be {n:"Rice", q: 5}. Also, how would I only get specifically only "Rice"? I don't really care about the q:
let arr = [
{n:"Chicken", q: 10},
{n: "Onion", q: 2},
{n:"Fish", q: 12},]
let other = [
{n:"Chicken", q: 24},
{n: "Onion", q: 8},
{n:"Fish", q: 9},
{n:"Rice", q: 5},]
To start with, I tried using this code... but it did the complete opposite, it grabbed everything else but "Rice".
let difference = arr.filter(i=>other.find(x=>(x.n !== i.n)));