Functional JavaScript
Intro
No, I don’t mean that JavaScript is normally not functional. Instead, this badge is to teach you how to write your JavaScript code using functions almost exclusively. There are a lot of interesting concepts that come about because of this:
- Pure functions, or functions that take arguments and return a value without mutating a variable outside of the function. This makes it so you know every time you run a function with the same arguments it will return the same value.
- Higher order functions, or functions that take a function as an argument and return another function.
- Immutability, or never changing the value of a variable in place. Once a variable is set, you never change that value.
- How to handle side-effects of your functions, like performing network requests or writing to a file
- The difference between imperative and declarative programming
It’s a powerful paradigm which JavaScript supports. Learning it will help prepare you to learn React, which is heavily inspired by a functional paradigm.
Suggested Learning
- Functional JavaScript Concepts - Learn difference between imperative, object-oriented, and functional programming
- Functional Programming Concepts - Awesome article listing all the concepts you need to know in functional programming.
- Great Functional Programming Interactive Guide
Requirements
- Complete the basic assignments in Functional JavaScript Workshop
- Show that you have completed the basic assignments in the workshop in the
#requirements
Discord channel to show you have passed this requirement off.
Extra Learning
- Rethinking For Loops
- Rethinking If Statements
- Functional Composition
- Functional Exercises - Tons of practice code to learn with
- Functional Programming Game
This list is by no means complete. Feel free to add an issue or put in a pull request to update it.