I am making a tool for deleting geometry from a model in browser.
At some step of the deletion process, I take an array full of indexes and create a Set from it to get the array of unrepeated indexes.
function GetSetFromArray(array){
return new Set(array);
}
This function has worked good for many models at the beginning. Since I want to process the deletion as fast as possible, I wanted to avoid using solutions that require .indexOf.
But when I try to delete from a big model, for example, an array with a length of roughly 15,000,000. I get the following error on the browser's console:
Uncaught (in promise) RangeError: Set maximum size exceeded

I want to know, what is the maximum size for creating a Set? Is it something that depends on the Browser? Or on the PC running the Browser? Is there a way to get that number? I think that maybe if I could get the size limit of the Set, I could then split the array to make a series of Sets and then use that?