Created
November 29, 2021 11:29
-
-
Save charlypoly/9f45873c4b72e3e7d8a192b5ae2cc071 to your computer and use it in GitHub Desktop.
TypeScript Force checking index accesses (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myPrices: number[] = [1, 2.4, 2.0] | |
const defaultPrice = myPrices[40] | |
// `defaultPrice` is of type `number | undefined` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment