
Introduction
We introduce the course on functional programming in JavaScript and explains motivations for creating the course. Why it's valuable to learn functional programming and how it enables developers to move from imperative to declarative programming.
We'll learn how and why provability is one of the major benefits of functional programming. we'll also go over an overview of the course. Topics include: function purity, closure, composition, immutability, recursion, lists/data structures, asynchronous programming, and functional programming libraries.
The difference between functions and procedures, giving the requirements for a function keyword element to be a function as opposed to a procedure.
Daniel demonstrates how functions in functional programming are named based on the semantics of the inputs and outputs of the function.
I'll explains why the causes of side effects are indirect inputs and outputs, and explains why they are unavoidable. I also explain how they invalidate the properties of functional programming.
We analyzes why a function is only pure if it isolates the inputs and returns the outputs based on the inputs alone, and not based on anything defined outside the function. The best way to evaluate the purity of a function, which is to look for areas where the programmer has high confidence, and ones where the programmer has low confidence.
How to refactor for function purity by identifying and then extracting or containing it, either moving side effects to the outer shell or reducing their surface area. We'll go over one way to contain impurity: by using wrapper functions, an impure function wrapped around a pure function.
We will learn the distinction between an argument and a parameter, explains what unary and binary functions are, and connects it all by explaining the idea of a function's shape.
How to change the arguments in a function to shape it, restricting an n-ary function into a unary function as an example. We'll walk through a flip adapter function that flips the arguments passed into another function.
Daniel introduces map, which takes a data structure and maps a transformation across each element, returning a new data structure of the same type with transformed values from the original structure.
Daniel discusses the filter method, mentioning that filter is an inclusion operation, and not exclusion. Filter is recommended for when there is a collection where values are being kept in or left out of the result.
Daniel defines reduce as a combination operation, starting with an initial value and generating a resulting discrete value from operating on the elements of the collection using a binary reducer function.
Daniel writes a calculator app from scratch in an object oriented programming, showing the object oriented model of programming which is code that is common in most applications.
We'll learn how to store state in objects and modify it throughout the lecture, also the if else branch logic necessary to write in this style of coding, making it more difficult to maintain in the future.
Great lecture to start getting our hands dirty and start writing a bit of code.
In this lecture we'll take the code from the previous slide and refactor it into a functional style to learn how we can take legacy code and adapt it with the functional programming concepts we have learned in the course.
This is a great exercise that will allow us to see how much more maintainable our codebase can be if written in a functional style.
Improve your code with functional patterns like pure functions, compose & map/reduce/filter...plus advanced concepts like fusion, transducing and monads!
Solidify your knowledge of functional JavaScript programming, including objects, arrays, and prototypes
Learn higher-order functions, closures, scope, master key functional methods like map, reduce and filter and promises and ES6+ asynchronous JavaScript. Go beyond the fundamentals of asynchronous JavaScript and use features and techniques that will help you reduce code and create smarter applications.
Learning how to build and manage asynchronous functional programs is perhaps the most important part of becoming an effective JavaScript programmer.