标签: javascript json
输入:
JSON.parse("{list : []}");
在控制台中生成:
VM9793:1 Uncaught SyntaxError: Unexpected token l in JSON at position 1 at JSON.parse (<anonymous>) at <anonymous>:1:6
答案 0 :(得分:6)
JSON要求对象键是stings,所以它必须是:
JSON.parse('{"list" : []}');