Skip to content
Advertisement

How to get the same value from 2 different arrays

JavaScript

Hi! There are two different arrays and I want to compare two arrays and find the id of selected animals from the zoo. How do I get the array of ids? Also, the id has to be a string. Thank you

Advertisement

Answer

Make a look-up table that gives the ID for each name, then use this to get the IDs of each selected animal.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement