Try to search your question here, if you can't find : Ask Any Question Now ?

How to Count Unique Arrays in a Multidimensional Array

HomeCategory: stackoverflowHow to Count Unique Arrays in a Multidimensional Array
Avatarjohn asked 1 week ago

I am looking for a way to not only find unique arrays within a multidimensional array, but also count how many times a particular array occurs.

For Example

var arr = [[1,2], [1,2], [1,3], [1,4], [1,4], [1,4]]; 
var uniqueArrays = []; 
var theCount = [];

// Code 

???

// Results
uniqueArrays === [[1,2], [1,3], [1,4]]
theCount ==== [2, 1, 3]

1 Answers
Best Answer
Avatarnaveen answered 1 week ago
Your Answer

4 + 20 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com