```js function fun(...dimentions){ const [layer,...d] = dimentions; return d.length ? Array(layer).fill(0).map(_ => fun(...d)) : Array(layer) } ```