hi you can create the nth dimension error in javascript one of the example is below
var apple = new Array();
apple[1] = new Array();
apple[1][1] = new Array();
apple[1][1][1] = 'yourname'
now you can use the recursive function to iterate through the array and check and pare every thing.