The other approach is to use the isSuperset() method, which determines if the argument is a subset of the collection where we're calling the method:
const myList = List.of(
List.of(1, 2, 3),
List.of(4, 5, 6),
List.of(7, 8, 9)
);
const isSuperset = myList
.flatten()
.isSuperset(List.of(2, 5, 8));
console.log('isSuperset', isSuperset);
// -> isSuperset true
As you can see, this is just another way of getting the same result as the prior example.
As a rule of thumb, if a collection is a subset of another collection, then the other collection is a superset. If a collection is a superset of another collection, then the other collection is a subset.