First Class Functions in JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • Please subscribe: / @devtutsco
    JS + TS mailing list: buttondown.ema...
    Website: nick.scialli.me
    --
    JavaScript has first-class functions. This means functions can be treated like other values, which turns out to be incredibly important behavior to understand as you advance as a JavaScript developer. The following three bullets represent important first-class function behavior:
    - Functions can be assigned to variables
    - Functions can be passed as arguments to other functions
    - Functions can be returned from other functions

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

  • @punklast447
    @punklast447 2 ปีที่แล้ว

    You helped me so much dude with writing my functional programming paper by letting me understand first-class functions better

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

    Wish you'd spent more time explaining the last part.

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

    We are waiting for the next tutorials. Good job bro👍🏻

  • @rahulrockz8354
    @rahulrockz8354 4 ปีที่แล้ว

    yeah thats great job Man !! i was searching for this all around and u know this is Worth Watching !! Please add more videos on javascript ur way of clear and easy explaination can earn u more subscribers :) btw i hit that button :p

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

    Thanks good tutorial can you make tuts about canvas image processing computer vision with javascript

  • @vuhoang3783
    @vuhoang3783 3 ปีที่แล้ว

    First of all, thank you for the video, it's very understandable. There are 2 things I want to ask:
    1. Does the second greeter() method is a callback?
    2. On GreeterMarker(), is this a closure?

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

    Great job but I found the tutorial too fast especially for beginners. It gets confusing. When you know something it just rolls of the tongue. If you do a video, do it at a slower pace and assume we don't know anything.

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

      I appreciate the constructive criticism! I’ll make sure to pace myself for future lessons. Thanks!

  • @BenjiFriedman
    @BenjiFriedman 5 ปีที่แล้ว

    In the second example, what is the syntax for passing arguments to the function being used as an argument?

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

      if you want to pass a function as an argument and make sure it will be called with specific arguments:
      sayHelloToPerson(function () { return sayHello(someArgument, anotherArgument) }, "Jack");
      or use an arrow function for a cleaner syntax:
      sayHelloToPerson(() => sayHello(someArgument, anotherArgument), "Jack");
      so instead of directly passing sayHello as an argument, we create a new anonymous function that calls sayHello with specific arguments and pass _that_ function as an argument instead

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

    98-0 great