Perform a Subset Check on Two Sets of Data
In this exercise, we are going to perform a subset test on 2 sets of data. We
will create a method on our Set
data structure called isSubsetOf
. This will
compare the first set against the second, and if the first set is fully
contained within the second, it will return true
.
For example, if setA = ['a','b']
and setB = ['a','b','c','d']
, then setA
is a subset of setB
, so setA.isSubsetOf(setB)
should return true
.
Test
{{test}}Console output