📜  如何打印嵌套对象的 json.stringify - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:40.279000             🧑  作者: Mango

代码示例1
var myNewObject = {key1:true, key2:17, key3: [
  {k1: 10, k2:true, k3: "test" },
  {k1: 11, k2:true, k3: "testing" },
  {k1: false, k2:42, k3: "foo" },
]}; // Your object that needs stringification

var stringifiedObject = JSON.stringify(myNewObject);   // Stringify it!
console.log(stringifiedObject);                        // Done!
 Run code snippet