How can I remove duplicates from 10.000 elements array of strings?
I have array of strings in format:
[ '[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],
[0,0,0,1,1,1,1,1,1],[0,0,0,1,1,1,1,1,1],[0,0,0,1,1,1,1,1,1],
[0,0,0,1,1,1,0,0,0],[0,0,0,1,1,1,0,0,0],[0,0,0,1,1,1,0,0,0]]',
'[[0,0,0,1,1,1,1,1,1],[0,0,0,1,1,1,1,1,1],[0,0,0,1,1,1,1,1,1],
[0,0,0,1,1,1,0,0,0],[0,0,0,1,1,1,0,0,0],[0,0,0,1,1,1,0,0,0],
[0,0,0,1,1,1,0,0,0],[0,0,0,1,1,1,0,0,0],[0,0,0,1,1,1,0,0,0]]', ....]
There are 10.000 of elements in it, and after deleting duplicates it should be about 500. For now i'm using this code, but it doesnt work since "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory" problem is poping out.
newarr = [];
for(var i = 0; i<arr.length; i++){
var idx = arr.indexOf(arr[i])
while (idx != 0) {
newarr.push(idx);
idx = arr.indexOf(wycinki[i], idx + 1);
}
}