Arrays in Typescript

Typed Arrays – Arrays where each element is some consistent type of value.

Multiple Types in Arrays

When to use Arrays?

When we want to represent a collection of records which some arbitrary sort order.
of same type.

https://stackoverflow.com/questions/49047886/whats-difference-between-array-and-tuple/49047969

Tuple vs Arrays

Tuple – A tuple is a grouping of unnamed, ordered values. Each value in a tuple does not need to be the same type.

Array An array is mutable collection. They are very efficient to create, but must always be a single type.

We have a literal object like this:

type alias

But Why Tuples!?

Here’s why we don’t really use it too much.

It does not describe what those numbers mean. It is not descriptive.

Let’s use object instead. It is much more descriptive because we are forced to put in a key.