What is Currying? - Coding Interview Prep
ฝัง
- เผยแพร่เมื่อ 6 ก.ย. 2024
- In JavaScript, currying is the process of breaking down a function that takes multiple arguments into a series of functions that each take a single argument. This allows you to create a new function by partially applying the arguments to the original function, so that you can call it later with the remaining arguments.
Check me out on:
Twitter: / jesserweigel
Instagram: / jesse.weigel
freeCodeCamp: / freecodecamp
Code Editor: Visual Studio Code
VS Code Theme: Seti
Your kid understood all of it.
Lol, he was home sick from school and wanted to see what I did for work.
Your kid in the back is priceless haha
One of the clearest explanations of currying I've ever seen.
Thanks! It was always a confusing concept for me.
Thanks for the video. I finally understood currying using your videogame analogy. At first it wasn't clear why would I bother saving a half baked function to use later but working with the analogy, I realized that I can perform multiple evaluations of a function while keeping one variable constant. Kind of like a save point, I can start at a certain point and try do different actions from there.
thank you so much for explaining currying
Currying is when you write code like a pajeet; the examples are top notch.
Best explanation and reason for use case
Thanks!
Man, I came here to learn how to cook a mean curry. But I'm leaving being able to pass a Senior Software Engineer interview question. I'm applying for jobs now.
so it's basically the decorator design pattern?
AFAIK currying used to implement the decorator pattern in a functional way.
3:19 How can we call withTitle with one parameter when it requires two. I feel that its function definition only needs title because Component is a class imported from React
I think you are correct
That's really nice one i knew i have been using this in vanilla js coding but didn't knew what it was called 🙈
Thank you so much. Crystal clear
amazing video and excellent usage
Thank you!
Great explanation!
Thanks!