Functional Programming Concepts
-
What is functional programming?
- 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?
- It returns the same result if given the same arguments, It does not cause any observable side effects
-
What are the benefits of a pure function?
- easier to test, no need to mock?,
-
What is immutability?
- unchanging over time, or unable to be changed
-
What is Referential transparency?
- f a function consistently yields the same result for the same input
Node JS Tutorial for Beginners #6 - Modules and require()
-
What is a module?
- js libraries/file
-
What does the word ‘require’ do?
- includes a module using the same name
-
How do we bring another module into the file the we are working in?
- require(./
'file-name');
- require(./
-
What do we have to do to make a module available?
- module.exports =
'file-name'
- module.exports =
- when do we use functional programming, are we already using it?