I have a string like this : 33,33,56,89,56
I need to find out how to calculate the number of similar strings parts in that string using both JavaScript?
like for 33,33,56,89,56 how many '33's and how many 56s are there? using JavaScript?
The split or match wont work here. actually the scenario is: There are several buttons having the same class and one custom attribute price here for product rows. Now on click event i am fetching the value like this $('.product_row').attr('price'); , now i need to calculate what product is being clicked here and how many times? and i need to calculate if it is a similar product being clicked , how many times it is being clicked?
So, it 33,33,56,89,56 this string will be generated dynamically.
Help here guys.