Deviopath › TypeScript

Is Adult

Easy · Basic Types

Write isAdult(age: number): boolean that returns true when age is 18 or more.

The boolean return type tells readers (and the compiler) that the function answers a yes/no question.

Next: Optional Parameter