Closed
Description
Bug Report
π Search Terms
object values entries undefined optional properties
π Version & Regression Information
- This changed between versions 4.2.3 and 4.3.2
β― Playground Link
Playground link with relevant code
π» Code
const a: { b?: 1 | undefined } = { b: undefined };
const c = Object.values(a);
console.log(c); // Returns [undefined] but c has type 1[]
π Actual behavior
c
has type 1[]
but can be equal to [undefined]
π Expected behavior
c
should have type (undefined | 1)[]