I have the below array. Did console.log for the array and it is as below
(3) [Array(4), Array(4), Array(4)]
0 ["jackpot", "cherry", "bar", "pear"]
1 ["raspberry", "raspberry", "raspberry", "lemon"]
2 ["plum", "crown", "lemon", "jackpot"]
I tried the below and in console i just see my array and 1 next to it
var counts = {};
currentResults.forEach(function(obj) {
var key = JSON.stringify(obj)
counts[key] = (counts[key] || 0) + 1
})
console.log(counts);
How can i search and find the duplicated values in the above array/object and count how many duplicated items I have with javascript/jquery?