Skip to content
Advertisement

Iterarting over array of objects and get unique values of each object

I have this variable inside data():

JavaScript

What I want is to check if a value from this input field:

JavaScript

is matching one of the keys of “jsonStatham” (uniqueOne/Two/Three) and then push the keys of the matching key into an array. so if the input === uniqueOne, so this array:

JavaScript

Will look like this: inputFields[“field1″,”field2″,”field3″,”field4″,”field5”]

That’s what I tried:

JavaScript

What I get in inputFields is “uniqueOne”,”uniqueTwo”,”uniqueThree”

Advertisement

Answer

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