function de(num) { if(num == 1) { return 1 } return num + de(num - 1) } function add(num) { if(num == 1) { return 1 } return num * add(num - 1) } console.log('xx', add(5)) console.log(de(10)) function getFib(x) { if(x==1||x==2){ return 1 } return getFib(x-1)+getFib(x-2); } let a = getFib(3) console.log(a) function getChild(arr) { if(arr.child.length == 0) { return arr.child = [] } return getChild(arr.child) }