How do I make an array of arrays in javascript

I’m just learning and I wanted to do something simple so I figured making an array grid in javascript would be easy enough. However, no matter what I do I keep getting the error ArguementOutOfRangeException. Any advice of information on what I did wrong would be greatly appreciated.

P.S I’m sure that there’s a more efficient way of doing this, like with lists or something, but I’m trying to practice with arrays.

#pragma strict

	public var iMax = 10;
	public var jMax = 10;
	public var f : [];
	public var i: int;
	public var j : int;

    function  Start () 
    {
	for (i=0;i < iMax;i++) 
	{
 		f*= [];*
  •  for (j=0; j < jMax; j++)* 
    
  •  {*
    

_ Debug.Log (f*[j]);_
_
}_
_
}_
_
}*_
I have this script attached to a random object, I figured it would work on anything but maybe I’m wrong.

While i’m not all that Familiar with JavaScript (I prefer C# myself) I’m not sure about your code in general.

Such as why you would need an Array, of arrays, why not just a multidimensional array.

I found this [1] that shows literal declaration of an array, but is somewhat different to your code. ( var arlene = [ ]; )

If I were to work off your code, I would hazard the guess that you are creating object f of type array so:

public var f : [ ]

Then, for X times (10) you make each part of F into an Array.

f[ [ ] ] or f _= [ ]_
In which case I would say the whole thing then should work, other than theres no data other than empty arrays so im not sure how Unity would feel about that.
How about you make an Array Var, which contains Arrays of ints, perhaps then something might print?
Just some ideas and thoughts.
[1]: Declare an Array in JavaScript