stringify-keep-undefined-value.js 141 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 var obj = { a: 1, b: null, c: undefined }; print(JSON.stringify(obj, function(k, v){ return typeof v === 'undefined' ? null : v; }));