Is there a way to retrieve the value in an object array based on a key that is present within the same array?
The structure of the object array is as follows:
const objectArray = [
{key: "1", value: "12321"},
{key: "2", value: "asdfas"}
]
For example, if I have the key's value as key = 1
, how can I obtain 12321 as the desired output? Are there any solutions available for this scenario?