Functional Programming
-
What is functional programming?
Functional programming is a programming paradigm — a style of building the structure and elements of computer programs — that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data
- What is a pure function and how do we know if something is a pure function?
your code can be used for multiple things and get the same output
- What are the benefits of a pure function?
it is easier to test and you don’t need to mock anything
- What is immutability?
unchanging over time and or unable to change
- What is Referential transparency?
your functions will get the same output and they are pure
Video Notes
- What is a module?
It is another javascript file that can be easy to use and can be extended
- What does the word ‘require’ do?
it will call the module and you are able to use it
- How do we bring another module into the file the we are working in?
you would use require and then use your
./
and then the path
- What do we have to do to make a module available?
you would use module.exports