TypeScript
Overview

TypeScript Exercises

Setup

To solve and test the correctness of those exercises, you need to have node installed. For this to work install fnm and run fnm install v20.

Then you can just create a file, for example ts01-exercises.ts and execute it via

npx tsc ts01-exercises.ts && node ts01-exercises.ts

or use tsx (opens in a new tab)

npx tsx ts01-exercises.ts

Notes

For these exercises always add the types for the arguments and explicitely define the return type of the function. This will be also required for normal coding and the module confirmations.

function product(a: number, b: number): number {...}