Here is the solution you've been looking for!
const firstValue = yourObject[Object.keys(yourObject)[0]].value
Let me break it down for you:
To access the keys of an object, you can use the Object.keys(obj)
method, which will give you an array of all the keys. In this case, since your object has only one key, you can get that key using Object.keys(obj)[0]
. This is the key you need to retrieve the value.
Once you have the key, use bracket notation to access the inner object:
obj[Object.keys(obj)[0]]
After accessing the inner object, you can then access the value stored within it!
Happy coding and solving your problem with this handy tip!