reading-notes

View project on GitHub

Class8

Return to home page.

Functional Programming

  • What is functional programming?

functional programming is a programming paradigm where programs are constructed by applying and composing functions.

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

In computer programming, a pure function is a function that has the following properties:

  1. The function return values are identical for identical arguments.
  2. The function application has no side effects.
  • What are the benefits of a pure function?

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 is an object whose state cannot be modified after it is created.

  • What is Referential transparency?

Referential transparency is a property 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.

Node.js

  • What is a module?

It is a simple or complex functionality organized in single or multiple JavaScript files which can be reused throughout the Node. js application.

  • What does the word ‘require’ do?

require function is the easiest way to include modules that exist in separate files.

  • How do we bring another module into the file the we are working in?

using the require function

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

using a render function