Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb29c5bc

Browse files
authored
JSON.stringify keys to serialize.
1 parent345f6cd commitb29c5bc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,29 @@ console.log(globalThis) //get the global this depends on your environment
431431
```
432432
433433
434+
435+
# The second argument of JSON.stringify lets you cherry-pick 🍒 keys to serialize.
436+
```javascript
437+
constuser= {
438+
id:459,
439+
name:'JS snippets',
440+
age:29,
441+
education:{
442+
degree:'Masters'
443+
}
444+
}
445+
446+
JSON.stringify(user,[name,age],2)
447+
448+
/*
449+
returns
450+
451+
{
452+
"name": "JS snippets",
453+
"age": 29
454+
}
455+
456+
457+
*/
458+
459+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp