---
type: snippet
tags: ['json']
status: release
ctime: 2022-04-09
mtime: 2024-03-22
---

[TIL — The power of JSON.stringify replacer parameter | pawelgrzybek.com](https://pawelgrzybek.com/til-the-power-of-json-stringify-replacer-parameter/)

```js
JSON.stringify(dude, (key, value) =>
  value instanceof Set ? [...value] : value
);
JSON.stringify(dude, null, "🍆");
```