[Fixed] How to get the value of an object in array by key in Typescript

Issue

I have some objects stored in localStorage, I need the value in the objects for some mathematical computations. how do I get them?

TCC:"[{"data":197}]"
PCC:"[{"data":30}]"
FCC:"[{"data":159}]"

I have successfully retrieved the items from loacalStorage, how do i get the values, i.e 194, 30, 159

Solution

yourVariable.TCC[0].data

should result in 197.

Leave a Reply

(*) Required, Your email will not be published