Functions – theory

Functions

Functions are one of the fundamental building blocks in JavaScript.  The basic syntax of a function do we call a function declaration. But there are other syntax possibilities for creating a function, like a function expression. This means that a function is assigned to a variable. In JavaScript a function is a value, and that’s why you can deal with it as a value, and assign it to variables. Nowadays developers often make use of arrow functions too.

High-order functions

High-order functions are functions that take another function as an argument, and/or returns another function.