Categories
Mastering Development

How do you sort/order a map function using .sort or lodash?

I have been trying to sort a map function with no results. I tried a few different methods but have not been able to sort by the section.tid. Is there a way to orderby a nested tid? Code: {data.policies.data.map((policy, i) => ( <div key={i}> <div> {policy.policy_sections .sort(({ tid: previousTID }, { tid: currentTID }) => […]