I have a scenario where I need to address the following issue:
I have an Object with a property called specs
. This property consists of an Array
that contains several other Objects
, each having two properties:
- name
- value
Here is an example of what my object looks like:
Object
-Title
-Date
-Specs [Array]
-- [0] Name: "Power"
-- [0] Value: 5
-- [1] Name: "Weight"
-- [1] Value: 100
Now, I would like to determine if my Specs Array includes an item with the name "Power". If it does, I want to access the value associated with that element.
Any suggestions on how I can achieve this?