javascript print object pretty

Solutions on MaxInterview for javascript print object pretty by the best coders in the world

showing results for - "javascript print object pretty"
Aurélie
28 Oct 2019
1//Prototype JSON.stringify(value[, function [, space]])
2var myObject = {"hello": "world", "!": []};
3var str = JSON.stringify(myObject, null, '\t');//space may be a string or a number corresponding to the number of space
4
5//What is displayed in the console
6{
7	"hello": "world",
8	"!": [] 
9}
10