FINALLY! Figured out how to compare 2 different data arrays for the new @mention notificaiton feature. Kudos to my Nuxt mates @yuyu and @keenencharles for all the help! 🍻

I want to compare the 2 arrays arr1 and arr2, and only return the objects where the values for username match. And then filter out only the ids of these matching objects in arr2 into a new array (arr3). I'm using arr3 to POST out the notifications.

forEach() - if() - push()
OR
filter() - includes() - map()
Yuyu

❀️

0 Likes

Please sign in to leave a comment.