What are Pure Functions? | Javascript Functions Tutorial

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

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.

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?"
"What is a Pure Function?"
"So You Want to Be a Functional Programmer (Part I)"

✅ Follow Me:

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

#pure #functions #javascript
Рекомендации по теме
Комментарии
Автор

Yours are some of the clearest and most useful JS tutorials on YouTube. Bummer it's hard to gain views with such advanced topics, but this makes your hard work just more valuable! Big respect.

movyllc
Автор

Wow, 1st video on JavaScript functions that I have come across that is not a person speaking broken English. It is hard enough to learn without having to decipher what the person is trying to say.

shamoozoid
Автор

This is the greatest JavaScript channel i could ask for. Your clear explanation of all of these JS concepts are incredibly helpful. Thank you so much for this content!

nycj
Автор

Today I have the "Dave Gray's video evening". One after another. And all of them are very informative and very easy to listen and absorb. 👉🏼🔥

Albert_Hall
Автор

You are the best man!
Whenever I want something advanced or to get an idea in depth I check if you have it on your channel first! It's like your channel is becoming my bible

moathdw
Автор

Awesome video Dave! I love functional programming and have been playing with the idea of making a video about currying.

TomDoesTech
Автор

Awesome content sir. Needed to brush up my memory on these small but yet important topics

bakihanma
Автор

You made the subject so pleasurable to follow, straight to the facts. Helping my favorite mentor to make it more to the YT algorithm, one comment at a time :)

matinsasan
Автор

Great video thanks Dave Sir.
Namaste from India.❤️🙏

imsagar
Автор

Thank you so much for this video! I always read that pure functions should not have any side effects, but never understood the meaning.

aileenchan
Автор

Thanks!
Seems quite important concept (...which requires a lot of practice).

shineLouisShine
Автор

Very concise and informative, thank you sincerely!

КлиментийКараваев-уз
Автор

Awesome job man! this is the best tutorial about this subject!

zaid
Автор

Thanks again Dave for the "DETAIL", it really really helps. And thanks on the MVC advice, downloaded an app with a OOP version and then one with a functional version and it really brought some insight of the inner workings of both. You have a way to help support your work there? again, thanks so much!

gordonmullen
Автор

thank you very much for this info bro! SO helpful!

aeronwolfe
Автор

Amazing tutorial. Thank you for making high quality contents!!

aya
Автор

@DaveGray a great tutorial and such a great playlist. but i have one question/correction timestamp 7:23. i think increment function doesn't break rule #3 which is mutating a variable because increment function is just assigning a value to x not mutating it and also primitive variables are immutable

surafelgetachew
Автор

Hi, Kindly try to upload the code in a GitHub repository. I Don't Know If you have a GitHub repository for this tutorial. But try to upload the code for other tutorials. Thank you for making this content! Big respect.

dforever
Автор

If a function not returning something means automatically it returns a undefined value. In this case it's not pure function? What if I explicitly return undefined?

damo