Tags
Language
Tags
March 2024
Su Mo Tu We Th Fr Sa
25 26 27 28 29 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 1 2 3 4 5 6

The Factorial Recursive Function: A language agnostic explanation with samples in Go and JavaScript

Posted By: AlenMiler
The Factorial Recursive Function: A language agnostic explanation with samples in Go and JavaScript

The Factorial Recursive Function: A language agnostic explanation with samples in Go and JavaScript (Programming Concepts Book 1) by Tony de Araujo
English | Feb. 19, 2016 | ASIN: B01BZMAPMY | 35 Pages | AZW3/MOBI/EPUB/PDF (conv) | 2.26 MB

The intent of this 30-page publication is to explain what happens when a function invokes itself and how it calculates the end result of a return statement, like for example,
return x * factorial(x-1)
When I call this function and ask for the 4 factorial, the function returns the value of 24. If you understand the steps that led to value 24 (how the calculation was made), then you don't need to read this booklet or do the exercises. However, if you are not sure how the above return statement comes up with 24 as a result since there are no obvious calculations in the script, then this booklet might help you grasp the concept.
The explanation and exercises are language independent. The examples are written in Go and JavaScript. However, the specific code discussed in the book is universal. Even if you come from another language (or have no programming experience but are curious about the subject) you should not have any problems with it. In fact, you will not be writing code at all since all exercises are done with pen and paper.