Best type safe way to check null or undefined in typescript
npm install ts-object-utilsnpm install --save ts-object-utils
To use:
``js
import ObjectUtil from "ts-object-utils";
let a: number | null = 0;
console.log(a*4); //Error: a might be null
if(!ObjectUtil.isNullOrUndefined(a)){
console.log(a*4); //Works
}
``