<script> //递归 function test(n) { if (n == 1) { return 1 } console.log(n) return n * test(n - 1) } console.log(test(3)) </script>
时间: 2024-10-27 07:03:28
<script> //递归 function test(n) { if (n == 1) { return 1 } console.log(n) return n * test(n - 1) } console.log(test(3)) </script>