R
Join ServerReactiflux
help-js
⛄Snowberb⛄ – 12-54 Jan 27
⛄⛄Snowberb⛄1/27/2023
What's a better way to do this instead of nesting 2 loops?
for (const template of instrumentTemplates) {
const { instrumentTypeId, name, instrumentTemplate } = template;
for (const instrument of instruments.data) {
if (instrument.instrumentTypeId === instrumentTypeId) {
instrumentsWithTemplate.push({ ...instrument, instrumentTemplate, instrumentType: name });
}
}
}
UUUnknown User1/28/2023
Message Not Public
Sign In & Join Server To View