Javascript too many constructor arguments

I am trying to import a coordinate set from external javascript. I should include about 78.740 elements in the constructor, but firefox just throws an error:
"too many constructor arguments"
Anyone have any ideas?

This is my code:

  function CreateArray () {   
 return new Array (
 ...
 ...
 ...
 78.740 elements later
 ...
 );  }
+6
javascript constructor arguments
source share
2 answers

Try an array literal, it worked for me (successfully tested on a million elements):

function CreateArray() { return [ ... ]; } 
+9
source share

You may have memory limitations, but are not sure.

What about trying to push () values ​​into an array instead of initializing all of them at once? Divide it into smaller pieces of data to add to the array instead of adding it to a single command.

 var a = []; a.push(1,2,3,4,5,6,7,8,9,10); a.push(1,2,3,4,5,6,7,8,9,10); a.push(1,2,3,4,5,6,7,8,9,10); a.push(1,2,3,4,5,6,7,8,9,10); // etc... return a; 
+1
source share

All Articles