JavaScript, Useful Code / November 28, 2017 Pretty-printing Javascript JSON Pretty-printing is implemented natively in JSON.stringify(). The third argument enables pretty printing and sets the spacing to use: var str = JSON.stringify(obj, null, 2); // spacing level = 2
Leave a Reply
You must be logged in to post a comment.