3 ms·
For what it's worth, you misread the output. The returned value was not a string, it was an error indicator: > JSON.stringify(42) '42' > JSON.strin
by yencabulator 3y ago
For what it's worth, you misread the output. The returned value was not a string, it was an error indicator:
> JSON.stringify(42)
'42'
> JSON.stringify(undefined)
undefined
> typeof JSON.stringify(42)
'string'
> typeof JSON.stringify(undefined)
'undefined'