- Notifications
You must be signed in to change notification settings - Fork1
juliomatcom/object-vs-functional-js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
We will learn through real examples howFunctional Programming can provide a better approach thanObject Oriented Programming- in some situations that we are currently dealing with.
In JavaScript we can choose to use either of the OOP or FP paradigms as much, or as little, as we like. So, what is Functional Programming in a nutshell?
- Immutable Data
Immutable datacannot be changed once created, leading to much simpler development and easier reasoning of appstate.
- Pure functions
A pure function is a function that, given thesame input, will always return thesame output, does not have any observable side effects and does not rely on any external state.
All this is possible because in JavaScript functions arefirst-class citizens. This meansfunctions are objects (of the typeObject), and, therefore, can be assigned as thevalue of a variable. The ability to use higher-order functions -a function that takes a function as an argument or that returns a function as a result- makes JavaScript a suitable language for functional programming.
- First round
- Second round
- Third round
About
A series of pure real examples how of Functional Programming could give us a better approach than Object Oriented Programmig
Resources
Uh oh!
There was an error while loading.Please reload this page.