JavaScript Pure Functions and Side Effects in 8 Minutes

preview_player
Показать описание
In this video, we'll be going over pure functions and side effects. I'll explain what they are, why it's important to understand them, show you some examples, and even quiz you on your new-found knowledge.

Though this isn't often seen as a "beginner" topic, I think it's really important to expose concepts like pure functions and side effects as early as possible so new developers can be enabled to not only developer interesting applications but do it in such a way that is clean and scalable.

Functions in JavaScript can serve a large number of different purposes. Pure functions aim to simplify and clarify the logic of your code. Side effects are byproducts of executing non-pure functions throughout your application

Timestamps:

0:00 Intro
0:37 What is a Pure Function?
0:57 Same Input, Same Output
2:31 What is a Side Effect?
2:56 Side Effect - Directly Mutate Outer State
3:41 Side Effect - Mutate Method Arguments
5:16 How to Avoid Producing Side Effects
5:58 Quiz Time

== Let's Connect ==

== Who I Am ==
I'm Ijemma, a frontend software engineer currently working in New York City. I make videos on all things JavaScript and, more broadly, frontend web development.

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

just found ur channel, amazing, and shoutout for the OP love.ur a good teacher

andplay
Автор

That was high quality! Keep it up dude, happily subscribed :D

mrviometal
Автор

Another high quality video! You're crushing it! A good followup would be some content around what's pure and what has side effects in the base language (e.g. Array.(map|reduce|etc.) vs Array.sort).

jherr
Автор

I really enjoyed this topic and your explanation is Dude.


May I know u r from which country...🙏🙏🙏

vinothkumarv
Автор

Hi, just a small clarification. At 4:11 you said: "Arguments of methods are actually references to their original value.". Thought this is true in case of passing non-primitive values such as an Array or a user-defined object as an argument to a function but when primitives like number, boolean, etc are passed to a function then they are passed by value and not reference. Great content btw. :) Subscribed!

yashpandey
Автор

Video actually is very useful for beginners. But... Beginners don't think about these kind of things before they meet their own precious sufferings of side effects. So it will be better to show them those bugs on more "realistic" examples to send them into developer's catharsis))

vitiok