Every JavaScript Developer Has Made This Mistake With Functions

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

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

  • @Hari983
    @Hari983 Год назад +21

    One thing I absolutely love about your channel is how you ruthlessly hunt "blind spots" that are very common yet rarely get the attention they deserve. Another gem by you

  • @llamafactorySA
    @llamafactorySA 3 года назад +138

    Bro, your hair is getting more and more magnificent. Enable god mode and go for a full Bob Ross.

    • @michellegiacalone1079
      @michellegiacalone1079 3 года назад +15

      Full Johnny Bravo.

    • @maema255
      @maema255 3 года назад +9

      More like Guile from SF, funny enough his name is Kyle :D

    • @hikari1690
      @hikari1690 3 года назад +7

      Please don't, everytime his hair levels up people like me lose more hair

    • @johnnyholiday1150
      @johnnyholiday1150 3 года назад

      lol

    • @Drewmccollin
      @Drewmccollin 3 года назад +1

      @@maema255 Kyle wins! Perfect!

  • @user-lp8ky5kk4o
    @user-lp8ky5kk4o 3 года назад +97

    "but what _is_ print?"
    _vsauce music starts playing_
    Edit: also, great video! I never really thought of giving functions properties like objects, I'm not sure how it's useful but it's interesting to know!

    • @ericskelton5191
      @ericskelton5191 3 года назад

      It would be a lot more useful if all the variables defined in the function were left as properties of the function object. It would only work if they got reset each time the function gets called

    • @iben1195
      @iben1195 2 года назад

      @@ericskelton5191
      Yeah that would've been very cool. All variables without definition become properties while those with definition work as they do now. That way you choose what to reinitialize and what to persist without stress.🤗

  • @DontJustSitThere
    @DontJustSitThere 4 месяца назад

    The hype is deserved, kyle. Great job and thank you.

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

    closures: allow us to introduce ourselves.

  • @anjelrana6901
    @anjelrana6901 3 года назад +12

    That is why we call these first class function

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

      First class citizens

    • @Hertog_von_Berkshire
      @Hertog_von_Berkshire 3 года назад

      That is why we call Javascript functions first class objects.

  • @scvnthorpe__
    @scvnthorpe__ 3 года назад +8

    I did a trickier, higher-order form of this mistake with a react interface recently
    Put my buttons as onClick={setState('such&such')} causing those to just run on render and fire off alarm bells with react
    Fixed it with onClick={() => setState('such&such')}

    • @karanparmar4318
      @karanparmar4318 3 года назад

      use currying it's better than creating arrow function on each render

    • @Kitulous
      @Kitulous 3 года назад

      @@karanparmar4318 wdym? what does currying have to do with it?
      for me currying is
      const f = x => y => x + y;
      const add5 = f(5);
      console.log(f(10)(20)); // 30
      console.log(add5(11)); // 16

    • @karanparmar4318
      @karanparmar4318 3 года назад

      ​@@Kitulous instead of making stuff complex and for reusability purposes
      you could create separate function for it like this that uses currying as well,
      currying doesn't mean you "should" pass and call arguments individually...
      I hope following snippet helps you in some way.
      //callback:
      const handleClick=(a,b,c,d)=>(event)=> {
      //handleYourCrap...
      }
      //render:

    • @Kitulous
      @Kitulous 3 года назад

      @@karanparmar4318 got it! yeah, I've been doing it kinda the same, but I was defining a separate function for each element and just passing it like

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

    Hate to say this, but this video is much easier to digest than the one on your JavaScript Simplified for beginners.

  • @thiagosannafreiresilva4366
    @thiagosannafreiresilva4366 3 года назад +3

    Thanks for the video!! I've always been confused about what people really meant by callback functions, you explanation was perfect and it just clicked. Cheers!

  • @madtkn
    @madtkn Месяц назад

    this video is spot on. thank you for pointing out this common mistake

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

    I started learning Js just like two months ago, i needed to rewatch some parts of the video to full understanding but i feel i ve learn this hard topic. Finding your channel was a realy lucky thing to me, im absorving all your content and feel im fast learning the essencial things about js and coding. Thanks for that, really

  • @yareyla
    @yareyla Год назад

    I'm new to developing, and OMG this video helped me A LOOOT to finally understand functions. Thaaank you

  • @enderger5308
    @enderger5308 3 года назад +3

    This is the first step to understanding Haskell: a function is a value which takes other values. Would be interesting to hear about making functions which make functions (allowing for staged execution and peaking at fully curried functions).

  • @grandpaghost77
    @grandpaghost77 Год назад

    If you are a beginner see his videos 2 times and make notes of it you will never again have to struggle about that topic

  • @princejones0077
    @princejones0077 3 года назад

    Thanks because I just learned that callback in callback("hello") can be treated as a key

  • @풍월상신
    @풍월상신 Год назад

    가장 명쾌한 설명입니다.
    JS 의 function 은 Object 이기 때문에,
    callFunc( calledFunc ) 또는
    callFunc( () => { doSomething } )
    이렇게 쓰는 게 맞다.
    () => { doSomething } 는 자체가 object 이기 때문이다.
    callFunction( calledFunc() ) 가 혼란과 에러를 발생시키는 이유에 대해 정확하게 이해했습니다.

  • @miriamolivier8321
    @miriamolivier8321 2 года назад +8

    Literally every video you make, make sense. Things I dont understand is understood right after I watch your videos. Thank you so much for the value you bring to the Web Dev wold.

  • @petarkolev6928
    @petarkolev6928 3 года назад +1

    Assigning a key:value to the function killed me :D :D :D Amazing explanations!

  • @your_utube
    @your_utube 3 года назад +1

    I thought that this is knowledge that is supposed to be common knowledge, but then again I have been in this world of software engineering for decades now. But if it is true that many are not aware, then this is a great video that is excellent in getting those many developers out there that are missing a great idea, informed. Thanks for the video, and no thanks to the 33 dislikes who do not get the point with training videos.

    • @teklinco8307
      @teklinco8307 3 года назад

      recommended channel if you are interested ruclips.net/channel/UCvu6J9q1AM6q4xysGqAvVyw

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

    so clear! I kinda learned it myself, but really appreciate how concise and clear your explanation is!

  • @reukiz6434
    @reukiz6434 3 года назад

    I been trying to understand callback function for a very long time and it just took less than a minute for you to explain what it is and i finally understooddddddddd...finallllyyyyyyyyyyyy
    Thanks 😭😭😭

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

    I'm liking your React course Kyle! Way better then another one I bought that was a lot more expensive. Very easy to follow and you explain the concepts well!

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

    One thing about functions few understand is that with IIFE syntax : (function x(){})(), from inside the function 'this' is always the CREATOR or OWNER of the function (usually Window at the top level), and that is because ALL vars in js (of which functions are just lists of instructions referenced by a var) are owned by whatever they are created inside of.
    If all you want is a singleton that runs once and returns a handle to an interface you created, then no biggie...but...
    If you use the syntax var x = new function(){} instead, the function is also immediately invoked - but from within the new function 'this' will be Object which is *often* what was intended because your whole point was to create a new execution context.
    I call this DIFO (dynamically instantiated function object). Crockford got this wrong IMHO. If you use DIFO syntax instead of IIFE, all the this=that b.s. is not needed because you are not having to compensate for 'this' not being what you expect it to be. Crockford says this was an error in js but if you do a LOT of console logging tests the elegant design of js makes sense.
    In js ALL vars are static, retaining their value between invocations of their enclosing function b/c they actually are data members ATTACHED to something, effectively a member of whatever it is created inside of - it's just confusing because much code is top level meaning it is owned by the Window object.
    Because of all this, IMHO all the new ECMA 6 syntax like the class keyword, construction, even object.create is just syntactic sugar for C type programmers who are having a hard time grokking how js works.

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

      Lovely comment

    • @blendedplanet
      @blendedplanet Год назад

      I made this comment almost a year ago but stand by it ;)
      @@NicholasShanks

    • @blendedplanet
      @blendedplanet Год назад

      arrow functions are likewise dumb b/c in practice not only do you hardly save any keystrokes, but to understand at a glance what the code is doing - it just makes it harder with virtually no upside imho b/c you have to mentally sort the various flavors of arrow functions

  • @leebuckle8288
    @leebuckle8288 3 года назад +18

    Great video Kyle! These concepts helped demystify JavaScript for me in a big way and I find it odd how little this concept is spoken about.
    Almost everything in JS is an object-like at a fundamental level, even Primitive types like strings. More specifically, there's usually a __proto__ key applied to these "objects" which refers to the blueprint of key value pairs that correspond to that data type. That's where methods like "string".tolowercase() and Array.map() come from.
    When declaring a function or number etc. it's similar to generating a new object from a class in the sense that the number, function, string etc. receives some default keys and values.
    I'm sure that you (Kyle) know all of this and I think it would make a great video which would help demystify JS for a lot of people like it did for me.

    • @Italiafani
      @Italiafani 3 года назад +1

      There's a noteworthy difference between string primitives and String objects instantiated using the constructor with the `new` keyword. The latter creates an object which is of type 'object', even though strings are normally of type 'string'. The constructor can be used to convert other things to strings, but it is safer to do so without using the `new` keyword. Using objects as strings disables us from comparing strings like we're used to, since `new String('str') !== 'str'`. It also causes unexpected behaviour if you're typechecking since all of the lines below evaluate to true:
      typeof String('str') === 'string'
      typeof new String('str') === 'object'
      'str' instanceof String === false
      String('str') instanceof String === false
      Primitives actually get converted into their wrapper objects (String in this case) behind the scenes if you're trying to invoke a method or a property of theirs, which means this too, is true:
      'str'.prototype === new String('str').prototype
      This behaviour is called auto-boxing.

    • @leebuckle8288
      @leebuckle8288 3 года назад

      @@Italiafani Sorry if I wasn't very clear, I was simply trying to say that they are object-like in the sense that they have keys and values, methods etc. just like typical objects. Besides, I mentioned making a video as Kyle would do a much better job than I could in a comment.

    • @Italiafani
      @Italiafani 3 года назад +1

      @@leebuckle8288 No problem, my fellow dev. I was just elaborating on your comment so people might know just a bit more than they did. I agree it's important to know that everything in JS behaves like an object, but I also think the difference I explained is something to keep in mind.

    • @awdwadawda352
      @awdwadawda352 3 года назад

      @@Italiafani so does the new keyword always generate an object with the "blueprint" that references the initial object?
      As in: in the initial it is a string, but with the new keyword you reference the initial value but create a new object of that initial value? (My explanation might not be very clear, indicating to me I don't think I really get the concept)

    • @leebuckle8288
      @leebuckle8288 3 года назад

      @@Italiafani Thanks for your input. I've edited my comment to be a bit more clear as to try and not confuse or give incorrect information. I should have mentioned that I'm by no means an expert on this matter, as is probably evident 😅

  • @paulpost7244
    @paulpost7244 Год назад

    Hey Kyle! You're the BEST when I comes to break down the fundamentals in a comprehensive and elegant way 🙏 In 03:50 When you say: Functions are just like normal objects, the only difference is that you can call a function using parentheses passing different PARAMETERS to it. Wouldn't be more correct to say ARGUMENTS since you here is referring to values passed to the function and not names defined in the function declaration? Or am I missing something in regards of parameter/argument naming in function callbacks?

  • @vygintaskirda2658
    @vygintaskirda2658 Год назад

    Wow this video is probably one of the best i haves seen as fresh JS and React coder. Always know how to use call back but never knew why am i doing it this way:D THX

  • @double-agent-ly
    @double-agent-ly 3 года назад +43

    Was kinda expecting something more with that title. If you’re an experienced coder you’d never make that mistake since its pretty self explanatory, especially if you’ve worked with other languages that have similar rules. In a beginner’s perspective I think they learn this very early on, but maybe not to the depth you explained.

    • @rahiprajapati4881
      @rahiprajapati4881 3 года назад +5

      100% agree

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

      Hmmm plz def "exp coder"?
      As ... Exp web dev coder?
      Desktop app coder?
      CMD line coder?
      Scriptor???

    • @noahhcams
      @noahhcams 3 года назад

      Yeah I’ve only been coding for about 5 months and this was nothing new to me

    • @gubigm
      @gubigm 2 года назад

      Yeah, object oriented 101

    • @akshaysingla951
      @akshaysingla951 2 года назад

      agree

  • @Spartan-im5sl
    @Spartan-im5sl 3 года назад

    thanks so much Kyle, it help so much how explained it

  • @christophgriehl6338
    @christophgriehl6338 3 года назад +1

    I really like that you cover more web theorie related content lately. I felt that more and more content related to your personal opinion (e.g. VSC extensions) took over. I subcribed because of the foundation principles and re-subed because you got back to those again.

  • @mykalimba
    @mykalimba 3 года назад +20

    Interesting insight into what a JavaScript function actually is, under the hood. But regarding usage when passing functions as arguments, I'm confused that there is any confusion over this.
    All you have to remember is that parenthesis "()" mean "DO THIS RIGHT NOW", and causes a function to be invoked IMMEDIATELY. So you only use them if/when you want the function to be called right at that point in your code. If you intend that the function be called LATER (as is the normal intent with a callback), do not use the parenthesis. Need it be more complicated than this?

    • @arjix8738
      @arjix8738 3 года назад

      Honestly if anyone is confused over this, that person skipped his code training. (in any language)

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

      @UC5uBCnYHtX2VR3yJbHi5Egg There is tremendous value in many of WDS videos. I just think in this case, the waters were muddied with a lot of superfluous information, and the gist could have been conveyed much more succinctly.

    • @Kitulous
      @Kitulous 3 года назад

      @@who41683 there's no elitism in that comment
      you should learn to respect others and not call them losers

    • @Kitulous
      @Kitulous 3 года назад

      @@who41683 @Darrys @Darrys

  • @tmagrit
    @tmagrit 2 года назад

    Very useful tips, dude. Thanks!!!

  • @gabdev
    @gabdev 3 года назад +4

    I love your videos so much Kyle, thank you for being so concise and helpful! You make every one of us better devs.

    • @teklinco8307
      @teklinco8307 3 года назад

      recommended channel if you are interested ruclips.net/channel/UCvu6J9q1AM6q4xysGqAvVyw

  • @paolocarretero8444
    @paolocarretero8444 3 года назад

    Awesome stuff as always Kyle, keep it up!

    • @teklinco8307
      @teklinco8307 3 года назад

      recommended channel if you are interested ruclips.net/channel/UCvu6J9q1AM6q4xysGqAvVyw

  • @Richard-jm3um
    @Richard-jm3um 3 года назад +6

    It just so happens that I'm learning JS today! lol
    Thanks appreciate the explanation!

  • @youssefmhamdi381
    @youssefmhamdi381 3 года назад

    This is amazing to know, thanks man!

  • @AmirPourhadi
    @AmirPourhadi 3 года назад +1

    Thanks Kyle. You really helped me to understand React and JavaScript. Love u man ❤❤

  • @christianmarquez6365
    @christianmarquez6365 3 года назад

    This makes so much more sense now! 😮

  • @Aditya.Santra
    @Aditya.Santra 3 года назад

    Very Helpful Video

  • @pranavwani
    @pranavwani 3 года назад

    Thanks, Kyle for sharing and continuous effort for sharing all the stuff its really help

  • @nikolakikanovic9740
    @nikolakikanovic9740 3 года назад

    Really neat introduce to OOP :)

  • @varshithkumar7782
    @varshithkumar7782 3 года назад

    Man this is so good. Thanks for this

  • @hugodsa89
    @hugodsa89 3 года назад

    So true, great video Kyle

  • @SasiKumar-no8mx
    @SasiKumar-no8mx 3 года назад

    It's just fundamental in JS, very simple to think, we use .call .apply .bind , so function is an object itself.... We can add more properties.

  • @ZuriPOL
    @ZuriPOL 2 года назад

    RUclips literally recommends me this right after I used it in my code

  • @WebDevChallenge-Ethiopia
    @WebDevChallenge-Ethiopia 4 месяца назад +1

    Web Dev Challenge-Ethiopia

  • @iben1195
    @iben1195 2 года назад

    What i learned from this video
    function TM( r ) {
    if(!( 'tracker' in TM )){
    TM.tracker = 0;
    TM.maxR = r;
    }
    console.log('relevant execution completed');
    TM.tracker++;
    console.log('you can only replay this message '+ (TM.maxR - TM.tracker) +' times');
    if(TM.tracker === TM.maxR){
    console.log('TM is self-destructing...');
    }
    }

  • @MrMelquize
    @MrMelquize 3 года назад

    Thanks mate!

  • @StellarWeb008
    @StellarWeb008 3 года назад

    That's why JavaScript is my favourite language.

  • @abhijeetnigam2630
    @abhijeetnigam2630 3 года назад

    Awesome man 😎😎😎

  • @madara_uchiha_WB
    @madara_uchiha_WB 3 года назад +1

    Yes bro sometimes I messed up with this and ultimately left that code, thank you for this... :)

  •  3 года назад

    Thanks a lot for this useful video. I came across this kind of problem recently, while I was trying to make a function, which was using a callback as an input parameter and use it across multiple components in Vue JS, but I got stuck and temporarely left the problem undone. Now I will definetly try again :). Thanks again and thumbs up

  • @Fooljuice
    @Fooljuice 3 года назад

    Yo this was so informative! Thanks for helping us fill in the gaps 🙂

  • @sivachandran2445
    @sivachandran2445 3 года назад

    Hey Kyle! Could you make a video of deployment ? Web hosting, DNS and so on ...

  • @geekchihabe
    @geekchihabe 2 года назад

    hello please, i have an input, i created a function to get the input value and put it inside a text, the problem is that i need the function to put the value inside the text multiple times and the function take the value and put it in the one only! so how can tell the function to whenever it finds the div to put the value it put it there (multiple times)

  • @gokulgokzz5672
    @gokulgokzz5672 2 года назад

    hi can you explain the difference between a factory function and a constructor function and it's applications?

  • @fabien2430
    @fabien2430 3 года назад

    stupid question: why no ";" at end of statments ? I didn't know we could skip them... is it new ?

  • @damonwu9658
    @damonwu9658 3 года назад

    Thanks Kyle and do you mind to make a video for JavaScript prototype? Wish to know a bit more from your video ~~

  • @jeroenvanrensen9505
    @jeroenvanrensen9505 3 года назад +1

    Really helpful

  • @attilagyen1446
    @attilagyen1446 3 года назад

    It's bit confusing to say that you pass a function print to another function as an input parameter. You pass a pointer which points to a print function or to be more explicit to the memory space on the heap where the memory for print function was allocated. Correct me if I'm wrong. Good vid btw.

    • @double-agent-ly
      @double-agent-ly 3 года назад

      Its abstraction. What you said is more confusing especially considering Javascript is a language where you don’t directly manage the stack, heap, etcetera. Maybe in languages like C that would make more sense.

    • @NigerianWeeb
      @NigerianWeeb 2 года назад

      Despite being a beginner, their comment was ironically more understandable. It my head, that's exactly what I see, 'passing pointers' that point to the 'print' function, as opposed to 'passing the function'.

  • @dirantechie9411
    @dirantechie9411 3 года назад

    Wow kyle am always great full with your content and tutorials I have leant alot from your working, Javascript it's awesome

  • @elian6019
    @elian6019 3 года назад

    Your videos ALWAYS blow my mind ; )

  • @JohanDG7
    @JohanDG7 3 года назад

    This is good and all, but when are you picking up that guitar?

  • @fsjay
    @fsjay 3 года назад

    Johnny Bravo knows JavaScript!

  • @DrNabeel20
    @DrNabeel20 3 года назад

    so cool 👍🏻 thanks

  • @timschulz_de
    @timschulz_de 3 года назад

    I love it. You're awesome 👌👌👌

  • @mittamoa
    @mittamoa 2 года назад

    Thanks !!

  • @74Bagas
    @74Bagas 3 года назад

    like Jeff (Fireship) said, "welcome to javaScript world"

  • @re.liable
    @re.liable 2 года назад

    Anonymous / Arrow / Lambda functions. When I started playing with them, the idea that "functions are also variables" finally clicked. And those are littered throughout JavaScript lmao

  • @SK-vg3mw
    @SK-vg3mw Год назад

    Function is just a variable, essentially like an object… makes sense! 🤯😂

  • @nicogarcia7302
    @nicogarcia7302 3 года назад

    Hi Kyle! First of all thanks for your content man ,it's really helpful...
    I started noticing your guitar on your videos, what type of music do you like to play? Any videos of that soon ;) Cheers!

  • @natqe4049
    @natqe4049 3 года назад +6

    Love you, Kyle

  • @benja-min1588
    @benja-min1588 3 года назад

    Reminds me of the "*Everything* in JS is an object" argument. (Which is not true). But still, good catch, Kyle, thank you for the info

  • @fariduzzamaansari1656
    @fariduzzamaansari1656 3 года назад +1

    Hey Kyle, thanks for the informative video. I'm sure a lot of people will benefit from this.
    I just wanted to point out that the whole idea of functions (which are essentially objects) to be used as a variable (like passed in as an argument or returned from a function etc) is known to us as "Functions are First-Class Objects or First-Class Citizens in JavaScript". Just a little terminology that can help people in interviews or elsewhere.
    Thanks!

  • @Andrew-pz8jx
    @Andrew-pz8jx 3 года назад +1

    If this makes sense, I just think of functions as a way to create a temporary scope like one of the worlds in our solar system. A world / planet has access to meteorites and other universal things from the universe but to return it back out to the universe we must explicitly return it (punch it back out like ultraman fist!).. hence return lol

    • @3bu22
      @3bu22 3 года назад

      Lol nice metaphor

  • @doniaelfouly4142
    @doniaelfouly4142 5 месяцев назад

    Thanks

  • @spider-boss2353
    @spider-boss2353 Год назад

    this video saved me

  • @debrad.castleberry2457
    @debrad.castleberry2457 3 года назад

    Awesome video

  • @r34ct4
    @r34ct4 3 года назад

    I'm confused. Isn't a function different in that it defines a bunch of code to execute? A plain object only contains properties, whereas a function executes a block of code (conditional logic, loops, etc)

  • @femaledeer
    @femaledeer 3 года назад

    What I find confusing is when a function is set to a const. The following will print "hello world" even though there is no explicit statement myWorld() to execute the function assigned to it. Makes no sense to me. If I set a const to a function it should mean that I don't want the function to execute until the const is called.
    const myWorld= setTimeout(() => { //setTimeout executes
    console.log("hello world")
    }, 500);

    • @Kitulous
      @Kitulous 3 года назад

      you assign setTimeout() call result to a constant, not a function

    • @Kitulous
      @Kitulous 3 года назад

      when you call setTimeout, it already creates a timer that calls the specified function in a specified timeout

    • @Kitulous
      @Kitulous 3 года назад

      idk if it returns anything even

    • @Kitulous
      @Kitulous 3 года назад

      setInterval returns a number that you can use later to clear that interval:
      const interval = setInterval(() => console.log("I will log this every second"), 1000);
      function stopLogging() {
      clearInterval(interval);
      }

  • @dasten123
    @dasten123 3 года назад

    It's surprising how many people get confused by this.. I don't really understand why

  • @modrzeweuropejski9611
    @modrzeweuropejski9611 3 года назад

    Hi, could you make a video about importing something from string variable?
    Something like:
    const dir = './img.png'
    import(dir)

  • @juleswinnfield9931
    @juleswinnfield9931 3 года назад +4

    Hmm, I think you need to change the name of the video (make too made rather?). I may have made this mistake loooong ago (couldn't even tell you if I did), but I worked with prototyping back in 2008 already which is the basis of what you're eluding to... I actually thought you were gonna talk about prototyping.
    And, my prototyping knowledge came from my Flash ActionScript 1 days which was based on ECMA.

  • @WorkSmarter__
    @WorkSmarter__ Год назад

    coming from java, sometimes its difficult to wrap head around weirdness of javascript

  • @d-o-n-u-t
    @d-o-n-u-t 3 года назад +13

    The function you defined, "print" actually overrides a JavaScript default function. Be ware!

    • @michellegiacalone1079
      @michellegiacalone1079 3 года назад

      It would only override it in that specific instance, though, right?

    • @farhanaditya2647
      @farhanaditya2647 3 года назад

      Well, it's just for educational purposes. And the _print_ function isn't even native to JavaScript, it's from the browser.

    • @d-o-n-u-t
      @d-o-n-u-t 3 года назад

      @@farhanaditya2647 ...which is where JS originated.

  • @DarkFlarePrince
    @DarkFlarePrince 3 года назад

    this just made more confused bro. I think I need to watch it a couple of times.

  • @ozzyfromspace
    @ozzyfromspace 3 года назад

    I've never made this mistake (maybe typos, but never because of a lack of understanding), so I feel oddly left out now 😂😂. The setting properties on functions thing was very cool though, never knew about that! ☮️🙌🏽🎊🏆

  • @amanjames6207
    @amanjames6207 3 года назад

    Nice one

  • @dineshrout2527
    @dineshrout2527 3 года назад

    Useful.

  • @BenniK88
    @BenniK88 3 года назад

    Amazing!

  • @stevenleonmusic
    @stevenleonmusic 3 года назад +1

    "Whether you're a novice or have been programming for years, I'm gonna blow your mind!" *proceeds to explain the most basic concept of JavaScript, that functions are first-class objects* No offense but I'm glad I had my adblocker on for this, you do not deserve any revenue for 7 minutes of content that should have been in your "Intro To" series back in 2018.

  • @harleyspeedthrust4013
    @harleyspeedthrust4013 3 года назад +1

    Types in typescript can also be functions if you're crazy enough

  • @MrEliyahilel
    @MrEliyahilel 3 года назад

    Hello Kyle and thank you for all of your content!
    (btw I really like how you styled the battleship game, amazing job!)
    Another example for the concept you delivered in this video is actually in REDUX actions creators...
    naturally we destruct action creators functions when we use bindActionCreators function.
    like this for example:
    const { actionCreator1, actionCreator2, actionCreator3 } = bindActionCreators(actionCreators, dispatch)
    we can see that we destruct those functions like regular objects.

  • @collins4359
    @collins4359 3 года назад

    what was the mistake?

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

    i get it thanks

  • @swapnilcodes
    @swapnilcodes 3 года назад

    Awesome...

  • @devilboy9103
    @devilboy9103 3 года назад

    good to know theses things but no use in real project 😁

  • @kang_prabh
    @kang_prabh 3 года назад

    You, my friend, know what you are doing!!!

  • @Pareshbpatel
    @Pareshbpatel 3 года назад

    Very insightful tutorial. Thanks, Kyle
    {2021-08-15}

  • @cwinter90
    @cwinter90 3 года назад

    I actually explained basically this entire video to a newer programmer today lmao 🤣 I have validation functions I made that return a function that were confusing him.

    • @teklinco8307
      @teklinco8307 3 года назад

      recommended channel if you are interested ruclips.net/channel/UCvu6J9q1AM6q4xysGqAvVyw

  • @joel-rg8xm
    @joel-rg8xm 3 года назад +1

    I actually learned the difference between passing a function With and Without parenthesis, thanks! even so, I downvoted the video because of the confusing accelerated explanation that as usual lookes more like thinking in a loud voice rather than TEACHING.

    • @teklinco8307
      @teklinco8307 3 года назад

      recommended channel if you are interested ruclips.net/channel/UCvu6J9q1AM6q4xysGqAvVyw