Created
August 29, 2021 13:26
-
-
Save tararoutray/0d1bf7d5cd8054499d3c6ecaf0e48651 to your computer and use it in GitHub Desktop.
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
// You can create a JavaScript Set by: | |
// → Option 1: Passing an Array to new Set() | |
const languages = new Set(['Javascript', 'Python', 'PHP']); | |
// → Option 2: Create a Set and use add() to add values | |
const languages = new Set(); | |
languages.add('Javascript'); | |
languages.add('Python'); | |
languages.add('PHP'); | |
// → Option 3: Create a Set and use add() to add variables | |
const js = 'Javascript'; | |
const py = 'Python'; | |
const php = 'PHP'; | |
const languages = new Set(); | |
languages.add(js); | |
languages.add(py); | |
languages.add(php); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment