score:2

Accepted answer
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>

<div id="react"></div>

score:2

let newArr = [];
arrPremium.forEach((el, idx) => { 
  let newEl = arrMedium.some(e => e.name == el.name) ? {name: el.name} : {name: "x"};
  newArr.push(newEl);
});

Related Query

More Query from same tag