TS2403

error TS2403: TS2403: Subsequent variable declarations must have the same type. Variable ‘window‘ must be of type ‘Window & typeof globalThis‘, but here has type ‘any‘.

Broken Code ❌

1
var window: any = window || null;

Fixed Code ✔️

1
var window: Window & typeof globalThis = window || null;