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?
It returns the same result if given the same arguments (it is also referred as deterministic), and it does not cause any observable side effects.
What are the benefits of a pure function?
The code is easier to test, and no mocking is needed; expected output will always be the same for a given input.
What is immutability?
The state of the object cannot change after it’s created.
What is Referential transparency?
Basically, if a function consistently yields the same result for the same input, it is referentially transparent.
What is a module?
A JavaScript file that you can utilize from within a different file.
What does the word ‘require’ do?
Allows you to reference an outside file through the file path.
How do we bring another module into the file the we are working in?
Export module, require in the file you want to reference, and set the module to a variable for use within the current file.
What do we have to do to make a module available?
Export module, require in the file you want to reference, and set the module to a variable for use within the current file.