Lecture Justus - Functional programming

OOP, situation IRL express in programming language. Objects. With variables you can redirect to objects. State, situation of your processor. State of your program. By calling functions you tell the program to switch states.

Functional; incoming data, send through transformation before it's a program. Some kind of factory metaphore. You don't have objects and no variables. (Minimal as possible)

  • Functions
  • Parameters

Pure functions; does nothing outside itself. Use something outside the scope. Funcions who have side-effects. See function more as library with books in it. You always get the same answer. Haskell best language to learn functional. learnyouhaskell.com

JavaScript is not a functional programming language. More object oriented.

Unary function (1 argument) so 1 return value. Functions as short as possible. Hoisting Functions get hoisted to the top. Functional programming reads as a book, names carefully chosen.

Pure vs Inpure. Purity Closure; higher order functions.


Every array you make, you can call map.

map(); input is array. Runs through a function. Returns an array with the same.length.

filter(); input is array. All elements that don't go throught the filter. length of the array is different.

reduce(); makes one output, only data.d

results matching ""

    No results matching ""