An Introduction to Higher-Order Functions in JavaScript

preview_player
Показать описание
Higher Order Functions are functions that can be passed as input to other functions
or functions that can be returned from other functions as output. It is enough for a function to fulfill one of these conditions to be considered a higher-order function.

Higher-Order Functions allow to create convenient abstractions so that it is easier to reason about programs and their structure. In JavaScript there are many higher-order functions built in, one of them is the sort functions defined as a method on the Array object.

Functional programming is a programming paradigm in which you build programs by composing functions. The computation is then the evaluation of those functions. Functional programming focuses on the usage of pure functions and on avoiding shared, mutable state. This programming paradigm is declarative. Functional code is usually more concise and easier to test.

In this mini series, we will embark on an exciting journey to learn a bit about functional programming by using JavaScript. Presented concepts will be mostly universal and applicable to other programming languages. This series is created with beginners and non-programmers in mind; don't worry, we will take it slowly!

#functional #javascript #memoization
Рекомендации по теме
Комментарии
Автор

You continue to amaze me, how well you can explain! Thank you so much for this learning experience! It feels like clouds were blown away and the sun shines as clear as never before!

RobertWildling
Автор

I think I finally understand the mechanism of creating functions with two pairs of brackets and two fat arrows 🤯🧠!! So awesome ❤️ So happy!! Impossible is nothing 😅 thanks a million Zaiste Sir!!! Juhuuu!! :D

seven
Автор

came for the javascript, stayed for the calming keyboard sounds

danieldesouzaramos
Автор

You could even pass console.log as a value for a defaultOutput argument for the profile function.

masquereseau
Автор

Where do objects as collections, for working data conserved in a JS application, factor into a functional programming paradigm? Are those return values, in the associated functions, what looks to get handled with referential transparency? Foregoing the conventional object literal constructs altogether? How so less susceptible to security breach?

LanguageSkillz
Автор

I think it's stupid to use "const variable = (shit1, shit2) => something;" if the arrow function has at least 2 lines. We already have a special syntax for function that cannot already be redefined by
default! Binding an arrow function to a const variable makes it messier and less readable. When people see the keyword "const" in an assignment, what follows can either be non-function expression or it can be a function expression/arrow function. However, when we use the keyword "function", it's immediately obvious what follows.

magno
Автор

U totally kind of copied and pasted Eloquent Jacascript

samoh
Автор

confusing and don't think i will ever understand this

TheNamesJT