Узнайте о функциональном программировании
Functional programming is a style of programming where solutions are simple, isolated functions, without any side effects outside of the function scope.
INPUT -> PROCESS -> OUTPUT
Functional programming is about:
1) Isolated functions - there is no dependence on the state of the program, which includes global variables that are subject to change
2) Pure functions - the same input always gives the same output
3) Functions with limited side effects - any changes, or mutations, to the state of the program outside the function are carefully controlled
The members of freeCodeCamp happen to love tea.
In the code editor, the prepareTea
and getTea
functions are already defined for you. Call the getTea
function to get 40 cups of tea for the team, and store them in the tea4TeamFCC
variable.