What is Currying? - Coding Interview Prep
HTML-код
- Опубликовано: 5 фев 2025
- 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.
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.
Your kid in the back is priceless haha
thank you so much for explaining currying
Thank you so much. Crystal clear
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.
Best explanation and reason for use case
Thanks!
That's really nice one i knew i have been using this in vanilla js coding but didn't knew what it was called 🙈
so it's basically the decorator design pattern?
AFAIK currying used to implement the decorator pattern in a functional way.
Currying is when you write code like a pajeet; the examples are top notch.
amazing video and excellent usage
Thank you!
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
Great explanation!
Thanks!