Last active
October 25, 2019 13:11
-
-
Save madflanderz/f71428b83f1ac2f9feb9d66502495a8b to your computer and use it in GitHub Desktop.
Extract Type from Array
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
const food = ['apple', 'banana', 'cookie'] as const | |
// 'apple', 'banana', 'cookie' | |
type Food = typeof food[number] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment