Created
June 20, 2023 10:05
-
-
Save alexsoyes/0bc8afa98bc40f6fc40cde2d755ed253 to your computer and use it in GitHub Desktop.
Exemple TypeScript : Dictionnaire (Map)
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
const map = new Map<string, number>(); | |
map.set("key1", 1); | |
map.set("key2", 2); | |
map.set("key3", 3); | |
console.log(map.get("key2")); // Output: 2 | |
console.log(map.size); // Output: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment