Closed
Description
Bug Report
π Search Terms
stringify, JSON.stringify undefined
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
stringify
β― Playground Link
Playground link with relevant code
π» Code
// hover over 'x', it's typed as string.
const x = JSON.stringify(undefined);
console.log(typeof x) // outputs "undefined"
π Actual behavior
Return type of JSON.stringify
is string
but it can return undefined
π Expected behavior
Return type should reflect actual set of values that could be returned: string | undefined
Metadata
Metadata
Assignees
Labels
No labels