An Introduction to Pure Functions in JavaScript

preview_player
Показать описание

--

Pure functions in JavaScript have two main constraints: they have identical returns for identical arguments, and the have no side effects.
Рекомендации по теме
Комментарии
Автор

Holy molly
This 1 is just gr8, eventhough i have not 100% got it. This is very close.

Pls keep posting more videos on js

nitroman
Автор

Thanks for such short videos....Keep going!

adisreyaj
Автор

🔥 When invoke the function, we can pass either a literal value or a reference.
The purity of the function depends on whether it uses only variables created by it, arguments or closures, and has no side effects. In this case val is an argument, so no matter what it is its value the function is pure.

gmkhussain