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]))

PulumiUP 2025 image

From Infra to Platforms: PulumiUP 2025 Panel

Don’t miss the expert panel at PulumiUP 2025 on May 6. Learn how teams are evolving from infrastructure engineering to platform engineering—faster, more secure, and at scale.

Save Your Spot

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay