reading-notes

What is functional programming?

Functional programming means using functions to the best effect for creating clean and maintainable software. More specifically, functional programming is a set of approaches to coding, usually described as a programming paradigm.

What is a pure function and how do we know if something is a pure function?

The definition of a pure function is: The function always returns the same result if the same arguments are passed in. It does not depend on any state, or data, change during a program’s execution. It must only depend on its input arguments.

What are the benefits of a pure function?

Major benefits of using pure functions is they are immediately testable. They will always produce the same result if you pass in the same arguments. They also makes maintaining and refactoring code much easier.

What is immutability?

An immutable object (unchangeable object) is an object whose state cannot be modified after it is created.

What is Referential transparency?

Referential transparency and referential opacity are properties of parts of computer programs. … An expression is called referentially transparent if it can be replaced with its corresponding value (and vice-versa) without changing the program’s behavior.

What is a module?

A module is a software component or part of a program that contains one or more routines. One or more independently developed modules make up a program. An enterprise-level software application may contain several different modules, and each module serves unique and separate business operations.Modules make a programmer’s job easy by allowing the programmer to focus on only one area of the functionality of the software application. Modules are typically incorporated into the program (software) through interfaces.

What does the word ‘require’ do?

The require() method is used to load and cache JavaScript modules. So, if you want to load a local, relative JavaScript module into a Node. js application, you can simply use the require() method.

What do we have to do to make a module available?

The first thing you do to get access to module features is export them. This is done using the export statement. You can export functions, var , let , const , and — as we’ll see later — classes. They need to be top-level items; you can’t use export inside a function, for example.