JSFiddle - React, Tailwind, and code Playground

by nsatija

JavaScript

let faveIds = moviesLocal.map(m => m.id)
movies.forEach(m => {
  if (faveIds.indexOf(m.id) > -1)
    movies[i].favourite = true
});