0

Given a function:

const UseColor = (name) => colors.brand.find(c => c.shade === name).color

that loops over an array of objects with hex values. Given multiple arrays of objects, how can I pass a second parameter, so that I can have a type parameter dynamically passed to the .find() method?:

const UseColor = (type, name) => color.type.find(c => c.shade === name).color

Matt
  • 1,561
  • 5
  • 26
  • 61

0 Answers0