function printNumbers(arr) {
let depth = 0;
let value = 0;
 
function walk(array, dp) {
for (let i = 0; i <= array.length; i++) {
if (Array.isArray(array[i])) {
walk(array[i], dp + 1);
} else {
if (dp > depth) {
depth = dp;
value = array[i];
}
}
}
}
 
walk(arr, 0);
 
return value;
}
console.log(printNumbers([1, [[20, 1, [101]], 2], [[-2], [[102, 100]]]]));
 
Code will run automatically after changes.
Code runs in an isolated environment.