Skip to content
Advertisement

How to find index of ‘items_tolookfor’ array of items in another nested Array List ‘nested_data’ in javascript

How to find index of ‘items_tolookfor’ array of items in another nested Array List ‘nested_data’ in javascript

JavaScript

How would I find indices for ‘items_tolookfor’ in the nested array list ‘nested_data’ Also, the corresponding data lies in the nested list ‘nested_data’ index[2][5]

I was trying this code:

JavaScript

Expected result to be a console log output array with matching data for items_to_look_for array object found in nested_data array object, which is 0: [2][5], 1:[2][5], 2:[2][5], 3: [2][5], 4: [2][5], 5:[][]

Advertisement

Answer

Here’s how you could go about that:

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