is relatively large — If you ever plan on refactoring — If you have a decently large group of people working on the code base — If you're spending a non-zero amount of time writing unit tests
Python, you can do that as well. let point: [number, number] = [7, 5]; This will only allow arrays with two number elements. This helps ensure that you're getting what you think you're getting.
numberToString = (n: number): string => n.toString(); The TypeScript compiler keeps track of inputs and outputs to make sure nothing strange will happen at runtime.
b => a + b; TypeScript: const curriedAdd = (a: number): (b: number) => number => (b) => a + b; curriedAdd(1)(2); const add2 = curriedAdd(2); add2(5); See it with Intellisense.
Array<number>; let names = Array<string>; That thing in the <> brackets is called a generic. It's not super wrong to think of it as a variable for a type.