Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save charlypoly/49e083e4861d39fd569a27cc778d29c2 to your computer and use it in GitHub Desktop.
Save charlypoly/49e083e4861d39fd569a27cc778d29c2 to your computer and use it in GitHub Desktop.
TypeScript Force checking index accesses (1)
let myPrices: number[] = [1, 2.4, 2.0]
const defaultPrice = myPrices[40]
// `defaultPrice` is of type `number`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment