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

ความคิดเห็น • 21

  • @ssrtherealrauthan
    @ssrtherealrauthan ปีที่แล้ว +15

    Your kid understood all of it.

    • @JesseWeigel
      @JesseWeigel  ปีที่แล้ว +6

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

  • @alish2001
    @alish2001 ปีที่แล้ว +9

    Your kid in the back is priceless haha

  • @danielluna7648
    @danielluna7648 10 หลายเดือนก่อน +3

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

    • @JesseWeigel
      @JesseWeigel  10 หลายเดือนก่อน

      Thanks! It was always a confusing concept for me.

  • @joshuapasaba1961
    @joshuapasaba1961 4 หลายเดือนก่อน +3

    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.

  • @etch-6261
    @etch-6261 หลายเดือนก่อน +1

    thank you so much for explaining currying

  • @RupluttajaGames
    @RupluttajaGames ปีที่แล้ว +4

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

  • @thydevdom
    @thydevdom 3 หลายเดือนก่อน +1

    Best explanation and reason for use case

  • @N1rOx
    @N1rOx 10 หลายเดือนก่อน +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.

  • @persiansatan
    @persiansatan ปีที่แล้ว +3

    so it's basically the decorator design pattern?

    • @JesseWeigel
      @JesseWeigel  ปีที่แล้ว +2

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

  • @jatinverma8432
    @jatinverma8432 ปีที่แล้ว +3

    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

    • @JesseWeigel
      @JesseWeigel  ปีที่แล้ว +1

      I think you are correct

  • @sunilchaudhary1206
    @sunilchaudhary1206 ปีที่แล้ว +2

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

  • @LBCreateSpace
    @LBCreateSpace 6 หลายเดือนก่อน +1

    Thank you so much. Crystal clear

  • @kishDoesThings
    @kishDoesThings ปีที่แล้ว +1

    amazing video and excellent usage

  • @recursivethinking
    @recursivethinking ปีที่แล้ว +1

    Great explanation!