Files
gitactionTest/depth.js
2025-09-05 11:09:58 +09:00

19 lines
339 B
JavaScript

const depth = (n) => {
if (n > 1) {
return {
children: {
include: depth(n - 1),
},
};
} else {
return {
children: true,
};
}
};
console.log(JSON.stringify(depth(1000)));
//console.log(JSON.stringify(depth(2)))
//console.log(JSON.stringify(depth(3)))
//console.log(JSON.stringify(depth(4)))