JSON.stringify() array bizarreness with Prototype.js
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to figure out what's gone wrong with my json serializing, have the current version of my app with and old one and am finding some surprising differences in the way JSON.stringify() works (Using the JSON library from json.org). In the old version of my app: JSON . stringify ({ "a" :[ 1 , 2 ]}) gives me this; "{\"a\":[1,2]}" in the new version, JSON . stringify ({ "a" :[ 1 , 2 ]}) gives me this; "{\"a\":\"[1, 2]\"}" any idea what could have changed to make the same library put quotes around the array brackets in the new