1. <script>
    2. function factorial(num) {
    3. if (num <= 1) {
    4. return 1
    5. } else {
    6. return num * factorial(num - 1)
    7. }
    8. }
    9. console.log(factorial(6))
    10. </script>

    image.png