I want to loop over an array of arrays structure in order to filter out the duplicate datetime string values, and push the unique datetime string values sorted in a new array. I have tried to use a nested forEach() method in order to compare each current key value with all the key values inside the array arr, and push them inside the res array in case of non matching situation, but it seems not working properly.
Here the array of arrays structure
arr =[
["some_value", "2016-11-23 18:11", 1]
["some_value", "2016-11-23 18:01", 1]
["some_value", "2016-11-23 18:01", 2]
["some_value", "2016-11-23 18:01", 1]
["some_value", "2016-11-23 18:22", 1]
["some_value", "2016-11-23 18:23", 1]
["some_value", "2016-11-23 18:25", 1]
["some_value", "2016-11-23 18:24", 3]
["some_value", "2016-11-23 18:26", 1]
["some_value", "2016-11-23 18:27", 1]
];
What I want to obtain as result
res = ["2016-11-23 18:01",
"2016-11-23 18:11",
"2016-11-23 18:22",
"2016-11-23 18:23",
"2016-11-23 18:24",
"2016-11-23 18:25",
"2016-11-23 18:26",
"2016-11-23 18:27"];
Can someone give me some tips on order to understand how to proceed?
