filmov
tv
Functional JavaScript Programming 5 - Recursive Functions (WITH EXAMPLE)

Показать описание
How to write Recursive Functions in JavaScript?
How to get started in Functional Programming on JavaScript?
In this video tutorial, I talk about the basics of Functional Programming by bringing in the Recursive Function. What is it? Find out in the video.
RECURSIVE FUNCTIONS:
=======================
1. Most common and famous functional programming technique
2. A function that calls itself repeatedly until a result is achieved
3. Loops can be rewritten in recursive style a lot of times
4. Most effective for solving problems involving iterative branching like fractal math, sorting or traversing nodes of non-linear data structures
5. Recursion is favored because the code doesn't require local variables
6. Easy to test because they ar written in a PURE manner
7. Tail Call Optimization - recursive function calls create havoc on a stack, and it is easy to run out of stack space. TCO is a way one can create a recursive style algo that uses constant stack space.
8. ES6 has recursion support and it still needs to grow.
Recursive Functions in Functional JavaScript Programming by Rocky DeRaze (WITH EXAMPLE)