Slightly less code (still un-golfed as that does not appear to be the
stated requirement described at OP) using the same/similar pattern.

let input_json_string = `{"z":null}`;
const convertJSONNullToUndefined = json => {
  const o = JSON.parse(json);
  for (const key in o) if (o[key] === null) o[key] = void 0;
  return o
}

convertJSONNullToUndefined(input_json_string); // do destructuring stuff
```
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to