Refactoring
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
Pure functions :
It is the function that returns a new value without making any changes to the existing variables or changing the css format, meaning that this function only returns a new value , example of Pure functions : Get random number function Get real time function
Functional programming is a programming paradigm in which we try to bind everything in pure mathematical functions style. It is a declarative type of programming style. Its main focus is on “what to solve” in contrast to an imperative style where the main focus is “how to solve”
Recursive Function
A recursive function is a function that calls itself during its execution. The process may repeat several times, outputting the result and the end of each iteration.
JavaScript supports functional programming .