Skip to content

Instantly share code, notes, and snippets.

@shawn-sandy
Last active September 2, 2023 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawn-sandy/502503eff425261f69fdef01d5577e2f to your computer and use it in GitHub Desktop.
Save shawn-sandy/502503eff425261f69fdef01d5577e2f to your computer and use it in GitHub Desktop.
typescript
// 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"
};
// 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