Homepage

Project/progress updates!

View the Project on GitHub modopo/reading-notes

Reading Class 09

Functional Programming Concept

1) Functional programming is a style of programming where results is usually derived, and not edited or mutable.

2) A pure function is a function that returns the same result if given the same arguments and does not cause any observalbe side effects.

3) The code is easier test, because no mocks are needed.

4) Immutability is a state where it is unchangning over time or unable to be changed.

5) If a function consistently yields the same result on the same input, then it is referentially transparent.

Modules and require()

1) A module is just a single or multiple JavaScript files which can be reused throughout the Node.js application.

2) require() reads a JS file, executes it and then proceeds to return the default export object.

3) You use require() the specific file/module.

4) Once you require() the specific module/file, you set it to a constant variable. Since the module exports an Object, we can use the Object methods, or see what properties it has.

Things I want to know more about