Recently, I encountered an issue with my TypeScript code (version 3.9.5):
const height: number = $(window).height();
This resulted in the following error message:
TS2322: Type 'number | undefined' is not assignable to type 'number'.
After some investigation, I found out that the relevant packages being used are:
"jquery": "^3.4.1",
"@types/jquery": "^3.5.0"
I am now looking for the correct approach to resolve this TypeScript issue. Any suggestions would be appreciated.