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

Commit0849988

Browse files
committed
Update example code
1 parente997f21 commit0849988

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ serialize({
4545
map:newMap([['hello','world']]),
4646
set:newSet([123,456]),
4747
fn:functionecho(arg) {return arg; },
48-
re:/([^\s]+)/g
48+
re:/([^\s]+)/g,
49+
big:BigInt(10),
4950
});
5051
```
5152

5253
The above will produce the following string output:
5354

5455
```js
55-
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"undef":undefined,"inf":Infinity,"date":new Date("2016-04-28T22:02:17.000Z"),"map":new Map([["hello","world"]]),"set":new Set([123,456]),"fn":function echo(arg) { return arg; },"re":new RegExp("([^\\\\s]+)", "g")}'
56+
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"undef":undefined,"inf":Infinity,"date":new Date("2016-04-28T22:02:17.000Z"),"map":new Map([["hello","world"]]),"set":new Set([123,456]),"fn":function echo(arg) { return arg; },"re":new RegExp("([^\\\\s]+)", "g"),"big":BigInt("10")}'
5657
```
5758

5859
Note: to produced a beautified string, you can pass an optional second argument to`serialize()` to define the number of spaces to be used for the indentation.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp