Reputation: 61
I am retrieving data from an API and one of the fields in the object it returns is @timestamp. When ever I try to parse this data like item.@timestamp
javascript throws an error because the @ symbol is reserved as a decorator. How can I retrieve data from a field that is using a reserved character?
Upvotes: 2
Views: 130
Reputation: 38767
Try using bracket notation instead:
item['@timestamp']
Hopefully that helps!
Upvotes: 1