ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
JavaScript Pure Functions - Tutorial for beginners
ฝัง
- เผยแพร่เมื่อ 16 ส.ค. 2024
- Pure Functions are an essential ingredient of functional programming, regardless of the language. In this video we cover the two major rules that make any function pure, benefits of pure function, as well as why some functions can't be pure. Let's have some fun yo!
This is episode 16 of 20 things Javascript Developers Should Know But Probably Don't.
00:00:00 Intro
00:01:15 What is a pure function?
00:01:52 Rule #1: Same input means same output
00:02:58 🔴 Live coding: Rule #1
00:08:37 Benefits of Rule #1
00:10:04 Testability
00:12:05 Rule #2: No side-effects
00:12:22 🔴 Live coding: Rule #2
00:15:07 Benefits of Rule #2
00:16:40 Impure functions 😱
00:18:17 Outro
ColorCode Etsy Merchandise store:
www.etsy.com/s...
Full playlist here: • 20 Things JavaScript D...
JavaScript Promises from the series "20 Things JS Developers Should Know but Probably Don't"
by ColorCode.io, Sina Jazayeri
** Announcement **
Full JavaScript Mastery course is coming! Sign up for Early Access here:
www.colorcode....
Episode 16: Pure Functions 🤘👨💻🔥🎉
Well done .. Craig!, Can you post more often ? :D Maybe some React stuff ?
Honey, wake up. ColorCode posted a new JavaScript video.
haha ♥
The song: counting bodies like sheep to the rhythm of the wardrums
Performed by: a perfect circle
I love your music references. 👍
Correct! Nice job
Javascript legend 🎉👍
Oh man, we need a video editing tutorial as well 😛🤩
I don't know why I am just discovering your channel, but I am so glad I did. You are a great tutor.🔥🔥
Thank you!
...when you find out your nascent skillset/hobby comes with a TH-camr that makes incredible content with clarity, humor, style, and beauty. And you just wish you could make him understand how much you appreciate him...
Thank you, Sina. You're like that indie film that is so special that you want everyone to see it and love it as much as you do. You're my developer-resource version of 'Sing Street' (2016). Or maybe 'You Can Count On Me' (2000).
[digital gratitude hug]
Thank you for the love, Johnny! Made my day. Great comment.
Sina I LOVE your way of teaching, it's just so simple, entertaining and helpful
Thank you!
You know you have the perfect combo. The videos are both interesting and useful.
I appreciate that!
i been browsing advanced Js tutorials all around, i got few but sounds boring, i really appreciate the energy you got while explain things, totally love it, can't wait for more content.
I appreciate that!
Bro thanks... The way you break down the entire language is awesome.
So happy to found your channel, it makes my frontend developer study journey so much better! Cheers
Cheers!
Brief, simple, clear and fun.
Thanks for this amazing learning material
🤘🏼👍🏼
Best conceptual coding videos ❤
🕺🏻
Love your style of video editing and how you present the concepts in such a fun way! You deserve much much more subscribers!
Thank you!
Thank you sinaaaa ❤
♥🙏
Your style of teaching is effective. I hope you get the energy to do something similar with Typescript. This series on JS is already one of the best ones on YT
Great suggestion!
great video as always. i think that you should address that functional programming is often about higher order functions and state separation
Welcome back with long waiting videos. Please continue. 😀
Will do!
man you are the best at acting and explaining complex stuff for me, i really enjoy your videos
Glad you like them!
Hats off to you, nice to have you back.
♥
Alright, im ready for the next video, keep em coming!
Soon
Intro and editing was on the next level 💥💥💥💥
Appreciate it!
You’ve explained pure functions in a way that I finally understand! 🎉 Thank you! 🙏🏼
Loving this whole series ❤ I found it searching for the Fetch API and have been back to watch the whole series 👌🏻
Awesome. Thanks!
hey, I love your teaching style. please make a video on Garbage collection and circular referenced objects.
Your videos are really great ❤ thankyou.
I request you plz do videos on React Hooks
You can't believe how good this tutorials are!
Thank you!
Also the no side effects is so important in state management and the core concept of libraries like redux. Never modify state directly. Only return an updated state
Yes!
I am in Love with your explanations Bro. It's Amazing.
Tysm!
Someone has been watching "Succession" hahaha hahahaha. Thanks a lot Sina, your content never let me down. Cheers!!
Thank you! Good show.
Such a wonderful tutorial ❤ Would you do an episode about design patterns and maybe software testing in the future?
Good ideas
Thank you so much! This is pure and simple to understand! Nice haircut! SO SO SO Looking forward to the next episode!!! Thank you again!!!!
Thank you! Coming soon
Love you soo much
your tutorials are first class
Thank you so much!
My favourite online coding teacher is back
♥🙏
We need consistent videos from Sin Jazzz 🎉
Been waiting so long for this series to continues! So glad that your back!
Ty!
Good sir , you are a gentleman and a scholar ❤
🙏
Your edits are awesome
Ty!
This video should be a preparatory course for React beginners 😏
I agree
Can we have a video in unit testing? But I'll probably learn it by myself till then) but I love your videos and type of teaching, and of course, I love you ♥😍😍
Thank you for your efforts
You're most welcome
Very nice video, just a small tip from me. It will be better if you keep the background music one notch down
Great Job Sina! Amazing content.👑 Kindly post react content as well
The best tutorials.
Ty!
Thank You for this video. ❤
You're welcome
Best content for understanding difficullt javascript concepts! Thankyou
Hi Sina, amazing work bro
I would like to suggest this topics for future videos:
💎 Getters and Setters
💎 Short circuit operator
💎 Event Propagation
Thanks for the quality of the content, greetings from Colombia
It can be argued that a function executing a console.log is an impure function, as its side-effect is writing to the console.
Absolutely correct
So creative representation.
🎉
One reason I love typescript. It catches a lot of this
I was hapoy to see you in my notification panel
Great video, great singing. I would add that while you can write pure functions in JavaScript, the language doesn’t support them the way some fancier languages do. For example in rust all functions are pure by default and the compiler guarantees this and you have to declare your intentions to be impure (to sin) by including self as an argument.
Pure presentation of Pure func👍👍
Nice one! ❤
Best. Intro. Ever. ❤
🎉
Salut to you as well, from Romania. Great series, my dude. You could fit right into a real brick-and-mortar University as a cool JS teacher.
Salut tot din Romania.
Hello Romania! 🇷🇴
Coding fact: If you write a function that sets the CSS variable for Sina's hair to 'hidden' and attach an onClick, you can transform him into Stanley Tucci. Add a 0.5s ease-in-out for a smoother transition.
This is based purely on the thumbnail to this video btw..
Comment of the year 🏆
I hope we get a "Qoli" face reveal by Episode 20 :)
Awesome video man!
It's a possibility 🤨
Thank you for the amazing content!
Sorry about the awkward questions but I really like you glasses. Could you tell me the brand and the model, please?
Thank in advance and keep up with the videos you're doing!
www.warbyparker.com/eyeglasses/dawson/azure-crystal-with-oak-barrel
Welcomeee baaack🔥🔥🔥🔥
🙏🏼
You deserve a lot more credits for your videos. ;)
Anyway, may I ask a video about the semi colon? Is it good, is it bad, why was removed... :D
I don't use them in these tutorials just to make things a little cleaner, and it doesn't really have an impact with some rare exceptions in return statements
@@ColorCodeioAh ok! Thanks! :D
Sir you’re an amazing teacher. I aspire to be as clear and concise with my videos as you are. May I ask how you do you color grade your videos (lut or preset?) bc they’re beautiful. Also how do you edit your self right beside your editor? Is it a template for your screen recording or editing software?
It's got more to do with lighting and a good lens than software. Watch some tutorials on lighting before getting into LUTs, then you can do color correction based on your environment.
Really curious, what is the tool you are using for the live coding? Looks useful, particularly for learning / testing ideas.
It's called RunJS. Here's my affiliate link: runjs.app/colorcode
Thank you 🐐
The inventor of fun JavaScript:
Javascript legend is back 🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳
🕺🏻🙇🏻♂️
I been waiting since long 😭😭😭😭
when is your course dropping ? cant wait!
Working on it as we speak. Make sure you join the list on www.colorcode.io
Rule 1 : one-to-one relation
GOAT!
🐐
Finally 🎉🎉🎉🎉🎉
🎉
Hey Sina! Wonderful video can youu tell me which editing software you use to edit your videos? Wow come on man sick editing!
Final Cut Pro + Apple Motion
@@ColorCodeio oh thank you Sina and can you make a video on expression and statements like a full video becz It is very confusing and I would be pleased to see u upload one, thank you in advance😅😄😄🙂
Amazing video thanks a lot Sina. BTW how do you get the code continuously running on the right pane? is that Quokka ? and how do you get it to run in a separate column?
It's called RunJS - Here's my affiliate link: runjs.app/colorcode
@@ColorCodeio Wow incredible! Thanks Sina :) BTW I love the Gholi cameos in your videos! Our beloved childhood friend ;)
wooooooohoooo you da best :))))
So are you
Extension for console??
RunJS.app/ColorCode
Waiting ... && ❤❤❤🎉🎉🎉
Hi, Please let me know how to use spotlight effect on Mac mouse, thanks!
boinx.com/mousepose/
Starting at 3:00, how do you access this clear code editing space in the browser? Which browser is it? How do I access this window? It’s so clean!
RunJS.app/ColorCode
He actuallyt made me drink water.. thanks yo
Stay hydrated! 🚰
I came looking for copper and found gold
Can you please do a video about side effect?
I cover side effects in this video
where is ur podcast :(
After the full JS course
what code editor you are using? i want that simplicity
RunJS.app/ColorCode
"JavaScript
MasterClass
Available Spring 2023" ...
hello, what font do you use ?
monaco
salut('Logan') never can be a pure function! It can unexpectedly return "Fu*k off" :))
aleluya! hehe
Are you a syrian living in turkey ?
Bro he is definitely an Indian American
Neither
Your videos are absolutely 🔥. Dude, dope a$$ jacket 🫡
Thanks! 🤘
The inventor of fun JavaScript: