Create an object from array. Object's keys will made from Array's values. Use this to filter
an array, keep only unique values, and maybe make something of them. This might be faster than using
ES6 [...new Set(...arr)], because it loops only once.
Returns
from array values. Duplicate array values have been removed.
Parameters
arr: any[]
array values will be used, keys ignored
value: any = true
any value to assign to each new item in object. Default value = true.
Create an object from array. Object's keys will made from Array's values. Use this to filter an array, keep only unique values, and maybe make something of them. This might be faster than using ES6
[...new Set(...arr)]
, because it loops only once.Returns