Set Flashcards
1
Q
Set
A
Let’s you store unique values in an iterable collection
2
Q
Set.add()
A
Does - adds value to the end of Set object
Params - value
Returns - Set obj with added value
3
Q
Set.delete()
A
Does - removes value from Set object
Params- value
Returns - true if value was in Set otherwise false
4
Q
Set.has()
A
Does - checks to see if element exists
Params - value
Returns - True if element exist or false
5
Q
Set.values()
A
Does - returns a new iterator object of values in insertion order
Params - none
Returns- - returns a new iterator object of values in insertion order