-1

I am getting an object by name response, which has a property by name attribute.

On hovering on

response.attribute

I see

"{"Coupon Circle":"coupon_circle"}"

in chrome developer tools.(see Image)

enter image description here

On doing below

JSON.parse(response.attributes);

I get

Uncaught SyntaxError: Unexpected identifier

What should I do in order to get the object out of it?

Mozak
  • 2,738
  • 4
  • 30
  • 49

1 Answers1

0

Use JSON.parse().

The string is a json-object, which can be converted to an object with JavaScripts native JSON parser. Pass the string to JSON.parse() and it will give you the object.

Lars Ebert
  • 3,487
  • 2
  • 24
  • 46