hello I need help creating the newProducts in the following example array dynamically without knowing what's in the other two arrays https://jsfiddle.net/od4267fv/ more explanation:
I would like to check
products = [
  {
    id: 1,
    name: 'product 1' ,
    liked:  false
  },
{
    id: 2,
    name: 'product 2' ,
    liked:  false
  },
  {
    id: 3,
    name: 'product 3' ,
    liked:  false
  },
  {
    id: 4,
    name: 'product 4' ,
    liked:  false
  },
  {
    id: 5,
    name: 'product 5' ,
    liked:  false
  },
]
likedProducts = [
   {
    id: 1,
    name: 'product 1' ,
    liked:  true
  },
{
    id: 2,
    name: 'product 2' ,
    liked:  true
  },
  {
    id: 3,
    name: 'product 3' ,
    liked:  true
  },
]
if proucts[product].id === likedProducts[product].id
newProducts.push(likedProducts[product])
else
newProducts.push(proucts[product])
please recommend suitable ways to do it
 
     
     
     
     
    