Last active
September 2, 2023 19:46
-
-
Save shawn-sandy/502503eff425261f69fdef01d5577e2f to your computer and use it in GitHub Desktop.
typescript
This file contains 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
// create a javascript type for and associative array | |
type AssocArray = { | |
[key: string]: string; | |
}; | |
// use the type to create an associative array | |
const myArray: AssocArray = { | |
"key1": "value1", | |
"key2": "value2", | |
"key3": "value3" | |
}; |
This file contains 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
// Do not add any other lines of code to this file! | |
import "@total-typescript/ts-reset"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment