var solution =
f=a=>
a[0]? // if a is an array
Math.max(...a.map(f)) // return the maximum depth of each element in the array
+1 // add 1 to increase the depth
:0 // if a is a number, return 0
// Test cases
result.textContent =
`[1] -> 1
[1, 2, 3] -> 1
[[1, 2, 3]] -> 2
[3, [3, [3], 3], 3] -> 3
[[[[1], 2], [3, [4]]]] -> 4
[1, [[3]], [5, 6], [[[[8]]]], 1] -> 5
[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14] -> 6
[[[[[[[3]]]]]]] -> 7`
.split`\n`.map(t=>(c=t.split`->`.map(p=>p.trim()),c[0]+"=="+c[1]+"c[0]+" == "+c[1]+": "+(solution(eval(c[0]))==c[1]?"Passed":"Failed"))).join`\n`
<input type="text" id="input" value="[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14]" />
<button onclick="result.textContent=solution(eval(input.value))">Go</button>
<pre id="result"></pre>