score:1

Accepted answer

you can merge the two arrays: using:

mergedarray = [...arr1, ...arr2]

dataone = [{
    "name": "adnan hassan",
    "count": 6960
}, {
    "name": "adnan",
    "count": 69666660
}]

datatwo = [{
    "metrics": {
        "competition": "low",
        "avg_searches": "6600",
        "competition_index": "22"
    },
    "keyword_annotations": {
        "concepts": []
    },
    "text": "dubai homes"
}]

let merged = [...dataone, ...datatwo]
console.log(merged)

// then after you can map the data based on what you want
console.log('--mapped data starts here--')
merged.map((val) => {
  console.log(val)
})

score:0

thank you @cypherjac for your direction. i solved this problam with https://lodash.com/docs/4.17.15#mergewith


Related Query

More Query from same tag