JSFiddle - React, Tailwind, and code Playground
by John Wick
JavaScript
/* var merchantIds = [
{
id: "1",
merchant_id: "100"
},
{
id: "2",
merchant_id: "200"
},
{
id: "3",
merchant_id: "300"
}
]; */
if (merchantIds) {
console.log('merchantIds:', merchantIds);
var ids = merchantIds.map(merchant => merchant.merchant_id);
console.log('ids:', ids);
}