json stringify and parse code example
Example 1: json stringify and parse
var Jazzman = new Object();
Jazzman.altura = 1.85;
Jazzman.edad = 41;
Jazzman.colorOjos = "azul";
salidaJSON = JSON.stringify(Jazzman)
console.log(salidaJSON);
var jsonTexto = '{"color":"blanco","km":100000,"esNuevo":false,"rueda":{"marca":"desconocida","estado":"malo"}}';
var coche = JSON.parse(jsonTexto);
console.log(coche);
Example 2: how to use json stringify in javascript
var Num=[1,2,3,4,5,6]
console.log("The Numbers Are "+JSON.stringify(Num))