0

My question is sort of stupid that why

JSON.stringify({"annotation": [{"x":1, "y":2}, {"x":1, "y":2}]})

does not return

{"annotation": [{"x": 1, "y": 2}, {"x": 1, "y": 2}]}

but returns

{"annotation":"[{\"x\": 1, \"y\": 2}, {\"x\": 1, \"y\": 2}]"}

and how can I get the first output?

Zifei Tong
  • 1,697
  • 1
  • 19
  • 32

1 Answers1

2

Are you using Prototype? This question may be related:

JSON.stringify() array bizarreness with Prototype.js

Community
  • 1
  • 1
Daniel Earwicker
  • 114,894
  • 38
  • 205
  • 284