JavaScript To Find the most frequent item of an array

If we want to filter the item from the array which is frequently used then we can follow the below Example Here in the below example the array jjarray contain ‘a’ 5 times , so the most frequently item will be a. Sample array: var jjarray=[3, ‘a’, ‘a’, ‘a’, 2, 3, ‘a’, 3, ‘a’, 2,… Continue reading JavaScript To Find the most frequent item of an array

Remove Duplicates from an Array with Set and Map

Set and Map are built-in data structures for storing collections of values, each with their own specific characteristics and use cases. Both Set and Map do not allow duplicate values, so we can use them to remove duplicates from an array by spreading the array into them: Example // create unique arrays with Map() const fruitsWithDuplicates2 = [ ‘Mango’, ‘Cashew’, ‘Barley’, ‘Mango’,… Continue reading Remove Duplicates from an Array with Set and Map