# Functional Programming

[Return to Home](https://sethppierce.github.io/reading-notes)

## Questions

### 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?- It returns the same result if given the same arguments (it is also referred as deterministic)
It does not cause any observable side effects

What are the benefits of a pure function?- the code is easier to test

What is immutability?- its state cannot be changed once it is created.

What is Referential transparency?- when a function consistently yields the same results for the same input.

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

What is a module?- splits up code into different functionalities.

What does the word ‘require’ do?- it allows us to reference our modules wherever we need to

How do we bring another module into the file the we are working in?- module.exports = thingtoexport

What do we have to do to make a module available? export and require it, and we assign the require to a variable.
