Lusona Tech Academy · Intermediate
TypeScript
JavaScript with types — used by most modern web apps (React, Angular, Node). Types, interfaces, unions, generics and strict mode.
1 modules · 3 hands-on lessons · 10 h · 0 XP
Sign in to keep your progress on every device.
Module 1 · Types
Basic types
Add a type after a colon: let age: number = 30; let name: string = "Ana"; let ok: boolean = true;. Arrays: number[]. Functions: function add(a: number, b: number): number { return a + b; }.
Your task
Write function total(prices: number[]): number that returns the sum of the prices.
🧰 Try it at typescriptlang.org/play, or install Node.js and run `npm install -g typescript`, then `tsc app.ts`. Here, Check reads your code and confirms the parts the task asks for.
