April 2018
Beginner to intermediate
426 pages
10h 19m
English
In this topic, we will cover the mathematical concept of intersection. The intersection of sets A and B is denoted by:

And is defined as:

This means that x (the element) exists in both A and B, thus sharing a or some of its elements with both A and B. The following diagram exemplifies the intersection operation:

Now, let's implement the intersection method in our Set class, as follows:
intersection(otherSet) { const intersectionSet ...