An ordered set of instructions. It reads input, follows rules, and produces output.
Loading...
Loading...
Workspace
typed JavaScript for product scale
Definition first
TypeScript is a programming language for writing exact instructions, often used for typed JavaScript for product scale. Start with one mental model: input goes through steps and becomes output.
app.tsRun tsc app.ts && node app.jsHabit Let the type error teach the missing contractAn ordered set of instructions. It reads input, follows rules, and produces output.
A value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
TypeScript compiler then Node.js is the place that actually runs code from app.ts.
First readable code
const name: string = "Ada"; console.log(name);
Output AdaLanguage lineage
See where TypeScript comes from, which languages feel close, and what to learn next.
large JavaScript products where refactors and API contracts matter
Zero base path
Question bank
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
TypeScript question 1. Choose the statement that matches type annotation.
TypeScript question 2. Choose the statement that matches interface shape.
TypeScript question 3. Choose the statement that matches union narrowing.
TypeScript question 4. Choose the statement that matches generic array.
TypeScript question 5. Choose the statement that matches type annotation.
TypeScript question 6. Choose the statement that matches interface shape.
TypeScript question 7. Choose the statement that matches union narrowing.
TypeScript question 8. Choose the statement that matches generic array.
TypeScript question 9. Choose the statement that matches type annotation.
TypeScript question 10. Choose the statement that matches interface shape.
TypeScript question 11. Choose the statement that matches union narrowing.
TypeScript question 12. Choose the statement that matches generic array.
TypeScript question 13. Choose the statement that matches type annotation.
TypeScript question 14. Choose the statement that matches interface shape.
TypeScript question 15. Choose the statement that matches union narrowing.
TypeScript question 16. Choose the statement that matches generic array.
TypeScript question 17. Choose the statement that matches type annotation.
TypeScript question 18. Choose the statement that matches interface shape.
Multiple choice
TypeScript question 1. Choose the statement that matches type annotation.
const age: number = 18;
Reference
tsc app.ts && node app.jsstring number boolean array object
const name: string = "Ada"; console.log(name);
object contracts reusable shapes
interface User { name: string }
const user: User = { name: "Ada" };
console.log(user.name);unknown union guard safe access
function label(x: string | number) {
return typeof x === "string" ? x.toUpperCase() : x + 1;
}