i want to ask how do we convert the contents of the array into a string and calculate the same value?
ex:
const arr = [1,1,2,2,3,3,3,3]
If arr contain
values 1 = red,
values 2 = white,
values 3 = brown
**I have tried with the if else method but it doesn't work
my expected output was
red : 2 white : 2 brown : 4
can anyone help me? Thank you in advance