This is a code-golf, so keep your code small!
The objective is to create a function that receives 3 arguments:
Rows(int): The max number of an item in each array;
Cols(int): The max number of dimensions (sub-arrays);
Val(*): The starting value in each item;
This function should return a multidimensional array with the proper size and with the items containing the value specified.
It should be able to return any number of dimensions.
Example:
var multiArray = createMultiArray(2, 4,'empty');
multiArray[0][0][0][0] === 'empty' //true
multiArray[0][0][0][1] === 'empty' //true
multiArray[0][0][0][2] === 'empty' //true
multiArray[0][0][1][0] === 'empty' //true
...
multiArray[2][2][2][2] === 'empty' //true