I am trying to show a order list in html when I load the order list from the backend. In a for loop the jquery should look if a ordered food exist multiple times.
Currently the list looks like this:
- Pizza
- Soup
- Pizza
- Pasta
I want it to show this way:
- 2x Pizza
- Soup
- Pasta
I already tried something like this
const allEqual = arr => arr.every(v => v === arr[0]);
allEqual([1,1,1,1]);