From Object-Oriented to Functional
Pure functions produce the same output value, given the same input. They have no…