JSON.parse("[1, 2, 3, 4, ]");
JSON.parse('{"foo" : 1, }');如上代碼,轉換這個字符串因為多了個逗號會報錯。有什么簡單辦法可以轉換成功js對象呢?
JSON.parse轉換報錯
MMMHUHU
2018-08-07 09:10:44