Last active
October 9, 2023 10:37
-
-
Save jordanst3wart/20cf8041d19f0d2b7255d879fedafb25 to your computer and use it in GitHub Desktop.
Typescript improvements
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
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