What are Pure Functions? | Javascript Functions Tutorial

  Рет қаралды 14,253

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 55
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
This tutorial will explain what pure functions are, how to write them, and why you should. A concept from functional programming, pure functions will keep your code clean, make it easy to test, and likewise, make it easier to debug. There are just a couple of rules for pure functions. I'll cover those and provide several examples along the way. If you are just beginning to learn Javascript, I suggest starting with my full 8 hour course tutorial here: kzbin.info/www/bejne/e5eknWyYrN-JkM0 🚀
@movyllc1934
@movyllc1934 2 жыл бұрын
Yours are some of the clearest and most useful JS tutorials on KZbin. Bummer it's hard to gain views with such advanced topics, but this makes your hard work just more valuable! Big respect.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 💯🙏
@shamoozoid
@shamoozoid 5 ай бұрын
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.
@Albert_Hall
@Albert_Hall Жыл бұрын
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. 👉🏼🔥
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you like them!
@nycj360
@nycj360 2 жыл бұрын
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!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're very welcome! 💯🙏
@aileenchan3741
@aileenchan3741 2 жыл бұрын
Thank you so much for this video! I always read that pure functions should not have any side effects, but never understood the meaning.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad I could help!
@moathdw910
@moathdw910 2 жыл бұрын
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
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words!
@TomDoesTech
@TomDoesTech 3 жыл бұрын
Awesome video Dave! I love functional programming and have been playing with the idea of making a video about currying.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks Tom! 🙏 I was thinking about that topic as my next, too. I think you should also make one. I'll check it out ☑️💯
@matinsasan
@matinsasan 2 жыл бұрын
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 :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Matin! 🙏
@bakihanma1865
@bakihanma1865 2 жыл бұрын
Awesome content sir. Needed to brush up my memory on these small but yet important topics
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful!
@imsagar3541
@imsagar3541 3 жыл бұрын
Great video thanks Dave Sir. Namaste from India.❤️🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 🙏💯
@imsagar3541
@imsagar3541 3 жыл бұрын
@@DaveGrayTeachesCode ☺️☺️☺️🙏🙏
@shineLouisShine
@shineLouisShine 2 жыл бұрын
Thanks! Seems quite important concept (...which requires a lot of practice).
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Louis!
@gordonmullen7272
@gordonmullen7272 3 жыл бұрын
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!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! I appreciate the kind words. And thanks for asking. This summer I plan to look into a Patreon and hopefully launch an email, too. 🙏💯
@surafelgetachew6278
@surafelgetachew6278 2 жыл бұрын
@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
@suhasrao4324
@suhasrao4324 Жыл бұрын
That increment function is not taking any parameters. It is changing the value of globally assigned variable x.
@theteachr
@theteachr Жыл бұрын
Assigning a value also a kind of mutation.
@matinsasan
@matinsasan 2 жыл бұрын
Rewatching this was a pleasure :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Matin! 🙏
@zaid4690
@zaid4690 3 жыл бұрын
Awesome job man! this is the best tutorial about this subject!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thank you Zaid! 🙏
@КлиментийКараваев-у8з
@КлиментийКараваев-у8з 2 жыл бұрын
Very concise and informative, thank you sincerely!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad it was helpful! 💯
@aeronwolfe7072
@aeronwolfe7072 Жыл бұрын
thank you very much for this info bro! SO helpful!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@aya2222
@aya2222 2 жыл бұрын
Amazing tutorial. Thank you for making high quality contents!!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯🙏
@joynal_dev
@joynal_dev 3 жыл бұрын
Great video. Learned a lot.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad to help!
@1dforever952
@1dforever952 2 жыл бұрын
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.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thanks for the request! For some of these short tutorials, I encourage viewers to simply recreate the examples as I go.
@tedndg
@tedndg 3 жыл бұрын
great explanation
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks Ted! 🙏
@jatilyadav4000
@jatilyadav4000 Жыл бұрын
Great Video... HATS OFF
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you liked it!
@doniaelfouly4142
@doniaelfouly4142 6 ай бұрын
thanks
@aliciapeter562
@aliciapeter562 3 жыл бұрын
Thanks Dave . Keep going PLS :]
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 💯🚀
@viniciusm.m.7822
@viniciusm.m.7822 3 жыл бұрын
Thanks a lot!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 💯
@damo190
@damo190 3 жыл бұрын
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?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
That's a good question! If you stick with the rules of Pure Functions... Does the same input always produce the same output? Are there no side effects? If it meets those expectations, it is considered Pure.
@robx_001
@robx_001 2 жыл бұрын
Amazing
@doniaelfouly4142
@doniaelfouly4142 6 ай бұрын
thanks
Shallow Copy and Deep Copy | Advanced Javascript Tutorial
26:36
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 5 МЛН
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 203 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,2 МЛН
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 852 М.
#48 What are Higher Order Functions? | JavaScript Full Tutorial
6:30
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 414 М.
Higher Order Functions in JavaScript Explained Simply
9:55
Teddy Smith
Рет қаралды 9 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 5 МЛН