1let data = {
2 name: "John Smith",
3 age: 30,
4 hobbies: ["Programming", "Video Games"]
5};
6
7// {name:"John Smith",age:30,hobbies:["Programming","Video Games"]}
8let miny = JSON.stringify(data);
9
10// The 4 parameter signifys 4 spaces. You can also use "\t".
11/* {
12 * name: "John Smith",
13 * age: 30,
14 * ...
15 */
16let pretty = JSON.stringify(data, null, 4);
1var Num=[1,2,3,4,5,6]
2console.log("The Numbers Are "+JSON.stringify(Num))
3//output= The Number Are [1,2,3,4,5,6]
4