我对于何时使用这两种解析方法感到困惑。
在回显我的json_encoded数据并通过ajax将其检索回来之后,我常常会困惑何时应该使用JSON.stringify和JSON.parse。
我得到[object,object]我的console.log字符串化时解析和JavaScript对象时。
$.ajax({
url: "demo_test.txt",
success: function(data) {
         console.log(JSON.stringify(data))
                     /* OR */
         console.log(JSON.parse(data))
        //this is what I am unsure about?
    }
});
json.stringify(json.parse(data))。