Created
January 31, 2018 09:33
-
-
Save attdona/502d67b99629592f368479ad8843b7d6 to your computer and use it in GitHub Desktop.
typescript map example
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
class MyMap { | |
[key: string]: string; | |
} | |
let map: MyMap = new MyMap() | |
map["key"] = "value" | |
console.log(map["key"]) | |
delete map["key"] | |
console.log(map["key"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment