readingnotes

View project on GitHub

Functional Programming Concepts

  • 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 — Wikipedia

  • What is a pure function and how do we know if something is a pure function? Pure functions are stable, consistent, and predictable. Given the same parameters, pure functions will always return the same result. We don’t need to think of situations when the same parameter has different results — because it will never happen.

  • What are the benefits of a pure function? referential transparency (you can replace a function call with its resulting value without changing the meaning of the program)

  • What is immutability? When data is immutable, its state cannot change after it’s created. If you want to change an immutable object, you can’t. Instead, you create a new object with the new value.

  • What is Referential transparency? Basically, if a function consistently yields the same result for the same input, it is referentially transparent.

Article source


Node JS Tutorial for Beginners #6 - Modules and require()

  • What is a module? A module encapsulates a set of related functions and components semantically related with its own functional responsibility. They have all the assets they need to work on their own and can be tested independently of the rest of the application.

  • What does the word ‘require’ do? if we want to use function else where in the application we use require function and that’s on the global object in nogf.

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

  • What do we have to do to make a module available? require,export.

Source