Limit JSON stringification depth
I wanted to stringify an object on the first level without including a third-party library / too much code. In case you look for the same, here is a quick one-liner to do so: var json = JSON.stringify(obj, function (k, v) { return k && v && typeof v !== “number” ? (Array.isArray(v) ? “[object … Read more