The second argument of JSON.stringify lets you cherry-pick ?? keys to serialize.
const user = { id: 459, name: 'JS snippets', age:29, education:{ degree: 'Masters' } } JSON.stringify(user,[name,age], 2) /* returns { "name": "JS snippets", "age": 29 } */
In the meantime, if you have any JavaScript questions, feel free to contact me. I'll do by best to create free articles to answer your questions.
Please follow me on LinkedIn / Twitter / Facebook / Codesandbox / Codepen.