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

Комментарии • 21

  • @ssrtherealrauthan
    @ssrtherealrauthan 2 года назад +22

    Your kid understood all of it.

    • @JesseWeigel
      @JesseWeigel  2 года назад +7

      Lol, he was home sick from school and wanted to see what I did for work.

  • @danielluna7648
    @danielluna7648 Год назад +4

    One of the clearest explanations of currying I've ever seen.

    • @JesseWeigel
      @JesseWeigel  Год назад +1

      Thanks! It was always a confusing concept for me.

  • @joshuapasaba1961
    @joshuapasaba1961 9 месяцев назад +4

    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.

  • @alish2001
    @alish2001 2 года назад +14

    Your kid in the back is priceless haha

  • @etch-6261
    @etch-6261 7 месяцев назад +2

    thank you so much for explaining currying

  • @LBCreateSpace
    @LBCreateSpace 11 месяцев назад +2

    Thank you so much. Crystal clear

  • @N1rOx
    @N1rOx Год назад +2

    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.

  • @thydevdom
    @thydevdom 8 месяцев назад +1

    Best explanation and reason for use case

  • @sunilchaudhary1206
    @sunilchaudhary1206 2 года назад +3

    That's really nice one i knew i have been using this in vanilla js coding but didn't knew what it was called 🙈

  • @persiansatan
    @persiansatan 2 года назад +4

    so it's basically the decorator design pattern?

    • @JesseWeigel
      @JesseWeigel  2 года назад +3

      AFAIK currying used to implement the decorator pattern in a functional way.

  • @RupluttajaGames
    @RupluttajaGames 2 года назад +4

    Currying is when you write code like a pajeet; the examples are top notch.

  • @kishDoesThings
    @kishDoesThings 2 года назад +2

    amazing video and excellent usage

  • @jatinverma8432
    @jatinverma8432 2 года назад +5

    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

  • @recursivethinking
    @recursivethinking 2 года назад +1

    Great explanation!