DEV Community

Bob J
Bob J

Posted on

Help using one array of data to select data from a second array

Help using one array of data to select data from a second array.

I need to .... based on the names in one array , match to the same name in the second array , but pull different information from that same second array.... both arrays are [[]] ???

Top comments (1)

Collapse
 
jfullerco profile image
jfullerco

If you’re using JavaScript have you tried a hashmap?

Array1.map(arr1 => Array2.map(arr2 => arr1[arr2.linked_element]))

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

If you found this post useful, please drop a ❤️ or a friendly comment!

Okay.