Recursion: by Randy Taylor; While You Don't Understand Recursion, Read Recursion: by Randy Taylor

Written by Swordfish | Published 2020/10/20
Tech Story Tags: algorithms | javascript | recursion | tutorial-for-beginners | iteration | recursion-explained | what-is-recursion | programming

TLDR Recursion is the purest form of coding; write a function that will call itself until you get what you want. To implement recursion we will create a helper algorithm: Identify what the smallest input is. Continually break down a larger input into smaller inputs and pass those smaller inputs back into itself. Define a "base case" that will stop the Recursion should the answer not be found. This is why creating a base case is essential to prevent an infinite loop. JavaScript is LIFO (last in first out call by call until the answer is found)via the TL;DR App

no story

Written by Swordfish | JS, React, Redux, Ruby, Rails, SQL, Python
Published by HackerNoon on 2020/10/20