JSFiddle - React, Tailwind, and code Playground

HTML

<pre id="container"><pre>

CSS

#container {
    white-space: pre-wrap;
    color: #999;
}

JavaScript

var serialized = function () {
    return {
        n: 8,
        o: null,
        b: true,
        s: 'text',
        a: ['a', 'b', 'c'],
        f: function () {
            alert('!')
        }
    }
};
var json = serialized.toString();

document.getElementById('container').textContent = json;