filmov
tv
JavaScript tips — Convert an array to a Set
Показать описание
JavaScript makes it easy to turn an array of any type into a Set of unique values. Just pass your array as the first argument to the in new Set, and the set will be automatically be created with values from your array (excluding any duplicates)
Much nicer than looping over the array to construct the set yourself!
#javascript
Much nicer than looping over the array to construct the set yourself!
#javascript