Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

What are Pure Functions? In this Javascript Functions tutorial, you will learn what pure functions are, how to code pure functions, and how pure functions will help your code be clean, easier to test, and easier to debug.

Subscribe https://bit.ly/3nGHmNn

JavaScript for Beginners: Full Course (8 hours): https://youtu.be/EfAl9bwzVZk

Javascript Shallow Copy vs Deep Copy Tutorial: https://youtu.be/4Ej0LwjCDZQ
Javascript Higher Order Functions Tutorial: https://youtu.be/7BeT6lsudL4

What are Pure Functions? | Javascript Functions Tutorial

(00:00) Intro
(0:15) What are pure functions?
(0:26) Why write pure functions?
(0:58) Rules for pure functions
(1:36) A look at Rule #1
(3:15) Always provide at least one parameter
(4:02) A look at Rule #2
(6:08) Impure function examples
(8:43) Refactoring to pure functions
(11:58) Higher Order Functions
(14:05) Review of Pure Functions

References:
"What Is a Pure Function in Javascript?"
https://www.freecodecamp.org/news/what-is-a-pure-function-in-javascript-acb887375dfe/
"What is a Pure Function?"
https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-pure-function-d1c076bec976
"So You Want to Be a Functional Programmer (Part I)"
https://medium.com/@cscalfani/so-you-want-to-be-a-functional-programmer-part-1-1f15e387e536

Follow Me:
Twitter: https://twitter.com/yesdavidgray
LinkedIn: https://www.linkedin.com/in/davidagray/
Blog: https://yesdavidgray.com
Reddit: https://www.reddit.com/user/DaveOnEleven

Was this tutorial about Pure Functions in Javascript helpful? If so, please share. Let me know your thoughts in the comments.

#pure #functions #javascript