-2
let apis = [{id: "1", name"api 1"}, {id: "2", name:"api 2"}, {id: "3", name:"api 3"}];
let applications = [{id: "1", name:"application 01", apis: ["1", "2"]}, {id: "2", name: "application 02", apis: ["2", "3"]}]
I’d like a result like that:
let resultado = [
{id: "1", name: "application 01", apis: [{id: "1", name:"api 1"}, {id: "2", name:"api 2"}]},
{id: "2", name: "application 02", apis: [{id: "2", name:"api 2"}, {id: "3", name:"api 3"}]}]
I am wanting each api to enter its respective application. I’m a little confused on the ideas still, I’m thinking you’ll probably have to use a reduce, but I don’t know how... Could you help me please
This answers your question? How to join two object arrays by different keys?
– Ricardo Pontual