An Introduction to Functors in JavaScript: The Basics in 9 Minutes with Examples

Описание к видео An Introduction to Functors in JavaScript: The Basics in 9 Minutes with Examples

A functor is a data structure that can be mapped over using a custom mapping interface. In order words, a functor asks as a wrapper around data which can expose that internal data with that mapping interface. The newly transformed data after mapping gets placed back into a new functor.

This process allows for some interesting composition, specifically function composition since we can chain functions to one another.

Functors are a central topic in functional programming. If you don't know much about functional programming, I made two other videos that touch on topics within the paradigm.

🎬 Subscribe to the channel! -    / @ijemmaonwuzulike  

Higher-Order Functions:    • JavaScript Higher-Order Functions in ...  
Pure Functions:    • JavaScript Pure Functions and Side Ef...  

Timestamps:
0:00 Intro
0:59 What Are Functors? Arrays as Functors
2:28 Functor Laws
2:38 Identity Law
3:14 Composition Law
5:50 Debugging with Function Composition
6:28 Promises as Functors
8:00 Build Your Own Functor
9:13 Make Your Functor Iterable

== Let's Connect ==
🐦 Twitter -   / ijemmaohno  

== Who I Am ==
I'm Ijemma, a frontend software engineer currently working in New York City. I make videos on all things JavaScript and, more broadly, frontend web development.

#javascript #webdevelopment #softwareengineer

Комментарии

Информация по комментариям в разработке