September 2017
Intermediate to advanced
216 pages
6h 8m
English
If you want to know that a list belongs to another list, you can use the isSubset() method:
const myList = List.of( List.of(1, 2, 3), List.of(4, 5, 6), List.of(7, 8, 9));const isSubset = List.of(1, 4, 7) .isSubset(myList.flatten());console.log('isSubset', isSubset);// -> isSubset true
The myList collection is a list of lists. So once you flatten it, you can pass it to the isSubset() method when it's called on the list: List.of(1, 4, 7). This returns true because myList contains each of these values.
Read now
Unlock full access