Skip to content

Instantly share code, notes, and snippets.

@jordanst3wart
Last active October 9, 2023 10:37
Show Gist options
  • Save jordanst3wart/20cf8041d19f0d2b7255d879fedafb25 to your computer and use it in GitHub Desktop.
Save jordanst3wart/20cf8041d19f0d2b7255d879fedafb25 to your computer and use it in GitHub Desktop.
Typescript improvements
Typescript enums are bad, and unsafe
Typescript map key are compared by reference and not by value.
ie.
```
const map = new Map<any,string>()
map.set({},'hi')
map.set({},'hi2')
console.log(map.keys())
# two keys: [Map Iterator] { {}, {} }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment