frequencies
Creates an object with the unique values of an array as keys and their frequencies as the values.
- Use
Array.prototype.reduce()
to map unique values to an object's keys, adding to existing keys every time the same value is encountered.
Creates an object with the unique values of an array as keys and their frequencies as the values.
Array.prototype.reduce()
to map unique values to an object's keys, adding to existing keys every time the same value is encountered.