Read: Class 09
Reading
Functional Programming Concepts
- What is functional programming?
- a programming paradigm -a style of building the structure and element 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?
- it returns the same result if given the same arguments (it is also referred as
deterministic
)
- it does not cause any observable side effects
- What are the benefits of a pure function?
- deterministic & predictable
- no side effects
- improved testability
- reusability
- concurrency and parallelism
- caching and memoization
- What is immutability?
- a characteristic of an object or data structure that cannot be modified after creation
- What is Referential transparency?
- production of the same output for the input without side effects
- simplifies reasoning, allows for equational reasoning / optimization, and testing
Videos
Node JS Tutorial for Beginners #6 - Modules and require()
- What is a module?
- a reusable block of code that encapsulates related functionality
- organize code into logical and reusable units
- What does the word ‘require’ do?
- used to include and import modules
- How do we bring another module into the file the we are working in?
- by using the ‘require’ function
- What do we have to do to make a module available?
- export the desired functionality from the module