Created
June 20, 2023 10:00
-
-
Save alexsoyes/6f4a4c7682903830d7b41f0ca2c5688c to your computer and use it in GitHub Desktop.
Exemple TypeScript : Set
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 set = new Set<number>(); | |
set.add(1); | |
set.add(2); | |
set.add(3); | |
console.log(set.has(2)); // Output: true | |
console.log(set.size); // Output: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment