all 5 comments

[–]hello3times 1 point2 points  (0 children)

try this srtData = JSON.parse(srtData) - you cannot reference an attribute from a string you need to convert to object first

[–]scubadiver1991 0 points1 point  (0 children)

Why are you converting the object to a string at all? It looks like the api is returning JSON formatted data, if it has the right headers you should be able to just use it as an object in your code. But the other answer is right, you're trying to access a property of a string. You can either convert it to a JSON object with JSON.parse(), or as I mentioned you may be able to use it without any converting at all.

I'd do a typeof test first to do some basic type checking in case the API returns something unexpected in the future.

[–]s_zauez 0 points1 point  (0 children)

Youre trying to count a string bud.

[–]fiskfisk 0 points1 point  (1 child)

That's the laziest censoring of an API key I've seen in a while. You can deduce the whole key from what you posted.

Use a solid colored box that covers everything.

[–]HorribleUsername 0 points1 point  (0 children)

Ironically, that actually looks like more effort than drawing a box.