Promptles
Programming Basics

TypeScript

intermediate

Definition

A version of JavaScript where you also label what kind of value each thing should hold, such as text, a number, or a list, so mistakes get flagged before the code runs.

In the wild

`function total(prices: number[])` says it takes a list of numbers. Passing it the text `"12"` is flagged in the editor right away.

More from Programming Basics