Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Learning Path: Functional Programming in JavaScript
Rating: 4.2 out of 5(112 ratings)
973 students

Learning Path: Functional Programming in JavaScript

Harness the power of functional programming to build and test real-world applications
Last updated 9/2017
English

What you'll learn

  • Discover the principles of functional programming
  • Learn the benefits and drawbacks of functional programming compared to other styles
  • Learn the language constructs of ES6 that are used for functional programming
  • Understand function composition and function sequencing in depth
  • See how to rewrite nested asynchronous callbacks with generator functions in a linear fashion
  • Understand how to model and use infinite sequences with lazy evaluation
  • Use a third-party library that simplifies communication with a server via an API
  • See how to set up your development environment, including automated testing

Course content

2 sections40 lectures5h 23m total length
  • The Course Overview4:50

    This video gives an overview of the entire course.

  • Imperative and Declarative Programming by Example10:44

    Our objective is to get a feel of the differences between functional programming and other programming styles such as object oriented programming, via a demonstrated code example.

  • Principles of Writing Code in Functional Style7:31

    We learn the principles of writing code in functional programming in depth: avoiding side effects by writing pure functions, and using immutable data structure. A code example introduces techniques used in functional programming.

  • Benefits and Drawbacks of Functional Programming6:34

    We will summarize the advantages and disadvantages of functional programming, and we will also offset some of the disadvantages with some optimization techniques.

  • Getting Started with ES611:06

    ES6/ES2015 is introduced from a functional perspective, so that we can build on these fundamentals to write clear, compact functional code.

  • Deep and Shallow Cloning in JavaScript5:46

    Using immutable data structures is a cornerstone of functional programming. Yet, the JavaScript support for immutability is not that obvious. This video raises awareness on the different types of cloning, and makes sure we don’t end up mutating our data.

  • Context Binding by Example7:49

    Functional programming techniques are mixed with other techniques in JavaScript. When it comes to handling events, timeouts, and other callbacks, we have to use techniques to connect functional code with its context. This video demonstrates how context binding is used as a connector.

  • Chaining and Function Composition12:58

    Reading pure functional code is often a riddle. We increase readability with object-oriented and functional techniques: chaining and function composition.

  • What are Higher Order Functions?5:02

    JavaScript functions are values. Therefore, functions can be passed to other functions, and they can also be return values of functions. This is how we create higher order functions, giving us a powerful way to write loops and callbacks in functional style. 

  • Handling JavaScript Arrays with Higher Order Functions8:18

    In functional programming, we often use higher order functions on arrays instead of using loops. Therefore, it is beneficial to learn about ways of handling JavaScript arrays.

  • Introducing Map, Reduce, and Filter8:50

    Even though forEach looks like a functional utility, it is not usable when our goal is to write side-effect free code. We should still substitute loops with proper functional constructs. Therefore, it is now time to introduce the map, reduce, and filter operations.

  • Joins with Map-Reduce7:26

    We will take some SQL SELECT statements and translate them to queries written using JavaScript higher order functions such as map, reduce, and filter. You will not only learn how to perform inner joins of two tables but you will also see an example performing a left join. We will also learn how to group our results.

  • Filtering Examples6:16

    SQL queries often contain filtering conditions. As we will see filtering in action, we will first implement the filter function using reduce. Then we will apply various conditions on our queries to filter our results. We will filter regular joins as well as aggregated results.

  • Converting an Array of Nodes to a Tree6:08

    This practical exercise will make you think out of the box a bit for understanding how advanced reduce functions can be implemented. We will use the reduce function to create a tree data structure from an array of nodes.

  • Definitions5:05

    You will learn some basic definitions and JavaScript constructs that we will use throughout the rest of the section.

  • Deep Dive into Currying10:44

    When writing higher order functions in functional style, you will often encounter the technique of currying. You will also need to understand currying for the purpose of understanding a partial application.

  • Partial Application11:15

    We will start with a comparison between currying and partial application. We will then implement partial application in JavaScript. After the implementation, we will revisit the bind function of JavaScript for the purpose of partially applying arguments of a function. We will conclude this video with writing a partially applied map function.

  • Rendering Templates Using Partial Application4:15

    We will use the principles of partial application in this section to implement a template renderer in JavaScript without using any external libraries.

  • Recursive and Iterative Solutions in JavaScript6:49

    You will learn what recursion is in mathematics and in software development. You will also find out about different types of recursion. At the end of this section, we will see how to transfer iterative solutions to recursive solutions using accumulator variables.

  • Optimization Techniques with Recursion11:14

    This section introduces some optimization techniques combating the drawbacks of using recursion. These optimization techniques are mixing functional and non-functional elements of JavaScript, tail call optimization, and memoization.

  • Your Functional Programming Utility Belt6:28

    You will review the main points learned in this volume in order to place them in your functional programming utility belt.

  • Your Learning Path2:31

    In this last video, you will construct a learning plan for yourself based on your own goals. You will also get some recommendations that will accelerate your learning curve.

Requirements

  • This Learning Path follows a theoretical and practical approach for developing maintainable applications in mostly functional style.

Description

Functional programming is a style of writing programs by simply composing a set of functions. It helps to write a lot of small reusable functions and simply call them one after the other. With regard to JavaScript, we have following features to our advantage:

•    Speed
•    Simplicity
•    Versatility
•    Server Load

If you're looking forward to building maintainable real-world applications by writing code in the functional way? If yes, this then go for this Learning Path.    

Packt’s Video Learning Path is a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.

Let's take a quick look at your learning journey. This Learning Path begins with an introduction to functional programming wherein you will understand the principles of writing functional code along with its benefits and drawbacks. You will learn to write code that is easy to understand, test, and debug using ES6. You will then see how to use currying, partial evaluation, map, reduce, filter, recursion, and other functional programming concepts in ES6. Next, you will learn generator functions and the ES2017 sync-await construct which will help you set up communication with a server via an API during implementation of a web application. As you progress, you will learn lazy evaluation to optimize performance of your web application. Finally, you will implement a web application demonstrating the practical usage of most of the features that you've learned throughout this Learning Path.

By the end of this Learning Path, you will have a thorough understanding of functional programming in JavaScript and should be able to build and test your own applications.

About the Author:
For this course, we have the best works of this esteemed author:
 

  • Zsolt Nagy is a web development team lead, mentor, and software engineer living in Berlin, Germany. As a software engineer, Zsolt continuously challenges himself to stick to the highest possible standards when improving his own knowledge. The best way of learning is to create a meaningful product on the way. Until you reach this state, the second best way of learning is to share with others what you learned and how you structure your thoughts.

Who this course is for:

  • This Learning Path is for developers who would like to improve their skills and expertise by sticking to the highest quality standards when it comes to writing code. Prior knowledge of JavaScript is needed.