142
rated 0 times
[
144]
[
2]
/ answers: 1 / hits: 62962
/ 12 Years ago, wed, july 25, 2012, 12:00:00
I have an array as follows,
var arr = ['ab','pq','mn','ab','mn','ab']
Expected result
arr['ab'] = 3
arr['pq'] = 1
arr['mn'] = 2
Tried as follows,
$.each(arr, function (index, value) {
if (value)
arr[value] = (resultSummary[value]) ? arr[value] + 1 : 1;
});
console.log(arr.join(','));
More From » jquery