At first, new Set(array) creates a set containing the items of the array. Internally, the set removes the duplicates.

Because the set is iterable, Array.from() extracts the unique items into a new array.

7. Conclusion

Array.from() static method accepts array-like objects, as well as iterables. It accepts a mapping function. Moreover, the function does not skip iteration over empty holes. This combination of features gives Array.from() a lot of possibilities.