Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3062048
json_stringify_root_replacer.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
474 B
Referenced Files
None
Subscribers
None
json_stringify_root_replacer.js
View Options
function
show
(
label
,
value
)
{
const
out
=
JSON
.
stringify
(
value
,
function
(
key
,
current
)
{
if
(
key
===
''
)
{
if
(
typeof
current
===
'function'
)
return
{
root
:
'function'
};
if
(
current
===
undefined
)
return
{
root
:
'undefined'
};
if
(
typeof
current
===
'symbol'
)
return
{
root
:
'symbol'
};
}
return
current
;
});
console
.
log
(
`
${
label
}
:
${
out
}
`
);
}
show
(
'fn'
,
function
demo
()
{});
show
(
'undef'
,
undefined
);
show
(
'sym'
,
Symbol
.
for
(
'demo'
));
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Apr 3, 8:03 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
521496
Default Alt Text
json_stringify_root_replacer.js (474 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment