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
It returns the same result if given the same arguments (it is also referred as deterministic) It does not cause any observable side effects
The code’s definitely easier to test. We don’t need to mock anything
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.
If a function consistently yields the same result for the same input, it is referentially transparent. —
set of related functions and components semantically related with its own functional responsibility.
intended to add separate pieces of code (“modules”) to the current scope
using ‘require’
exports