Omit needless names

In notebook:
FrontEndMasters Hardcore Functional
Created at:
2017-01-27
Updated:
2017-07-15
Tags:
Functional Programming JavaScript Fundamentals
Through separations and recognitions

Separate inputs from environment

jsbin.com/yoyip 

Shows a date manipulation example. The function does not take an argument, but uses ​new Date()​ internally. Then the improved version takes year and month as arguments and returns a calculated value.

The above jsbin example shows, that a function that clearly separates its inputs are much easier to test (like the one above). You don't have to mock out secret inputs (like new Date inside)