#Javascript ES6, 44 43 42 bytes
Saved 1 byte thanks to @Neil
a=>a[0]?!a.some(b=>b.length-a[0].length):a
Alternative solutions
a=>a[0]?a.every(b=>b.length==a[0].length):a // 43
a=>a[0]?new Set(a.map(b=>b.length)).size==1:a // 45
a=>a[0]?Math.max(...a.map(b=>b.length))==a[0].length:a // 54
a=>a[0]?[a[0].length,...a].reduce((b,d)=>b==d.length):a // 55, doesn't work as intended
Somehow the stacksnippet doesn't print []
, try it in your console for the actual result.
f=
a=>a[0]?a.every(b=>b.length==a[0].length):a
z.innerHTML = [
[],
[[1], [1], [2]],
[[1]],
[[1, 2, 3, 4]],
[[1, 2, 3, 4, 5], [2], [12, 314123]],
[[1, 2, 3, 4], [1]]
].map(m=>fm=>JSON.stringify(f(m))).join`<br>`
<pre id=z>
(yay for crossed out 44)