Skip to content

Instantly share code, notes, and snippets.

@Sstobo
Created January 15, 2018 23:51
Show Gist options
  • Save Sstobo/c51476ce43562bd9d7eeaf68fb239f4b to your computer and use it in GitHub Desktop.
Save Sstobo/c51476ce43562bd9d7eeaf68fb239f4b to your computer and use it in GitHub Desktop.
[Functional Programming] #react #js
Procedural Programming
###### Pure function
- function that does not rely on data outside of its scope. Just does itself. No side effects.
- one output
- if it manipulates a global variable, it is impure (copy list into new variable, output that
- take an argument, make it newVariable, modify, output
{ robot.name = "Sean"} is a "reference" <- this will modify a global variable
{ robot = { name: "Sean" } } is "pass by value" <- this will not leave scope
" = Higher Order function = Function within a function
# type Array.prototype. in console to see a list of functions
MAP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment