User Tools

Site Tools


java-script:object-to-string-and-back

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
java-script:object-to-string-and-back [2023/08/11 12:53] odeftajava-script:object-to-string-and-back [2023/08/11 12:59] (current) – [Notes] odefta
Line 90: Line 90:
 } }
 </code> </code>
 +
 +To ski age from being included:
 +<code javascript>
 +const obj = { name: 'John', age: 30 };
 +const filteredJSON = JSON.stringify(obj, ['name']);
 +console.log(filteredJSON); // '{"name":"John"}'
 +</code>
 +
 </note> </note>
java-script/object-to-string-and-back.1691747604.txt.gz · Last modified: 2023/08/11 12:53 by odefta