I have the following code:
let statistics = this.video.getStatistics();
let currentLikeCount : number = statistics!.getLikeCount() ? statistics.getLikeCount() : 1;
However, I get the following error when compiling with Typescript
error TS2322: Type 'number | null' is not assignable to type 'number'.
My conditional checks to see if the like count is null, and, if so, assigns it to a number, but typescript still complains about it possibly being null.
How to I properly assign the like count to a number?
getLikeCount?