How to convert a Set to an Array? – JavaScript

When you remove the duplicate numbers from an array with new Set() method, it turns into a set instead of an array like this let duplicates = [1,2,3,4,5,6,2]; // remove the duplicates let noDuplicates = new Set(duplicates); // output Set {1,2,3,4,5,6} Duplicates may...