JS format JSON

如何用 Javascript format JSON
解決方法:
我們可以使用JSON.stringify 來 format
e.g.

var c = {a : "test", b:{ data: "asdada"}}

JSON.stringify(c, null, 4)
"{
    "a": "test",
    "b": {
        "data": "asdada"
    }
}"

Hope you find it useful

Chi Yau
Chi Yau
Software Engineer

Interested on Learning new stuff and experience sharing