Skip to content

🎃 Functional Programming with Javascript + Scala

Notifications You must be signed in to change notification settings

phamphihungbk/fpjsscala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎃Functional Programming Javascript

The repository to practice functional programming with Javascript.

Javascript knowledge:

Currying: Currying simply means evaluating functions with multiple arguments and decomposing them into a sequence of functions with a single argument.

Closure: A closure is a function having access to the parent scope, even after the parent function has closed.

Hoisting: JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code. Hoisting allows functions to be safely used in code before they are declared.

FP Principles and Practice:

  • Immutability
  • Disciplined state
  • Pure functions and no side effects/disciplined states
  • First class functions and high order functions
  • Type systems
  • Referential transparency

Javascript Debug notes:

  • console.assert(false condition, "message")
  • console.dir(): used for dom element
  • console.log({object})
  • console.table(map): used for object, map
  • console.time - console.endTime: time measurement

Reference Documents: