November 2018
Beginner
502 pages
10h 22m
English
Let's have a go at some questions on advanced types:
interface ICourseMark { courseName: string; grade: string;}
We can use this interface as follows:
const geography: ICourseMark = { courseName: "Geography", grade: "B"}
The grades can only be A, B, C, or D. How can we create a stronger typed version of the grade property in this interface?
function isNumberPopulated(field: number): boolean { return field !== null && field !== undefined;}function isStringPopulated(field: string): boolean { return field !== null && field !== undefined && field !== "";}
How can we ...
Read now
Unlock full access