if(typeof i[p] === typeof 3){//it's an int
sum += i[p];
}else if(typeof i[p] === typeof [3]){//it's an array recursion(i[p]);
}pretty simple no?
sum += i[p];
}else if(typeof i[p] === typeof [3]){//it's an array recursion(i[p]);
}pretty simple no?
I dread to think what obscure code I've left behind.
You should learn a little more about JS before you call this simple.