Created
May 29, 2017 05:25
-
-
Save vaidehijoshi/004242dd0f2884d794bb61a7c3b26a82 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
var s = new Set(); | |
s.add(2); | |
// Set { 2} | |
s.add(45); | |
// Set { 2, 45} | |
s.add(45); | |
// Set { 2, 45} | |
s.add('hello world!'); | |
// Set { 2, 45, 'hello world!' } | |
s.has(2); | |
// true | |
s.has('cats'); | |
// false | |
s.size; | |
// 3 | |
s.delete(45); | |
// Set { 2, 'hello world!' } | |
s.has(45); | |
// false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment