I've an object and a 1-D array like this:
nodes = {"id": 'Habitat for Humanity', "reflexive": true};
nodes = {"id": 'Caring', "reflexive": true};
nodes = {"id": 'Helping', "reflexive": true};
nodes = {"id": 'People', "reflexive": true};
nodes = {"id": 'Security', "reflexive": true};
nodes = {"id": 'Shelter', "reflexive": true};
nodes = {"id": 'Community', "reflexive": true};
nodes = {"id": 'Volunteering', "reflexive": true};
var sources = ['Helping', 'Community', 'Caring', 'Safety', 'Security'];
I want to find out the index of an element taken from the 'sources' array in the 'nodes' object. For example, the element 'Helping' in the 'sources' array is located at index 2 in 'nodes' object. So I need "2" as my solution when I search for index of the word "Helping". Can somebody help me on this? Thanks.