Immediately Invoked Function Expression - Beau teaches JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

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

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

    Awesome. short, clear, to the point! thanks!
    usefull extra-information!:
    I had the first situation, where i got errors, caused by not using semicolons.
    so after that self-calling function you HAVE to put the semicolon, since () followed by ( is valid syntax, and thatfore no semicolon is added/interpretet internally.

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

    wow. normally when i watch JS videos on youtube, i don't understand what is happening at all. but i actually understand this video. this is amazing.

  • @meeeeeraj
    @meeeeeraj ปีที่แล้ว

    best explanation this used to be super confusing for me thank you

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

    wow that was really clear, finally understood it!! thank you!!

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

    This was the video I needed to finally understand IIFEs, thanks!

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

    Very clear, and especially appreciate the new ES6 block scope syntax comparison.

  • @harrazmasri2805
    @harrazmasri2805 ปีที่แล้ว

    my senior was using this and led me here. thanks

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

    I finally think I understand IIFEs. Thank you!

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

    This was very hepful. Thank you so much for taking the time to make this!

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

    You guys are the best, thank you for creating freecodecamp. And thanks Beau for making this video.

  • @edosaogbevoen7985
    @edosaogbevoen7985 ปีที่แล้ว

    Straight to the point. Thanks sir

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

    Thanks for actually helping me understand this

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

    Great explanation. Thank you so much.

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

    This video explained the value of let and const to me in es6

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

    Hello. Great video, and very useful. But two things: it was hard to follow because it seemed to be fast forwarded, and new concepts were being introduced in rapid succession, making it hard to keep up. The second thing is it was difficult to follow when the console log was halfway cut off of the screen and you kept jumping back and forth between the console and the environment. And yet, a whole wealth of black space exists in the middle of the screen. If you would just move the screen margins over so the viewer can see the whole environment and the whole of the console, that would be very helpful for comprehension.

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

      i realize I'm quite off topic but do anyone know a good website to stream new tv shows online ?

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

      @Jonah Princeton flixportal xD

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

      @Blaze Taylor thanks, signed up and it seems like a nice service :) I appreciate it!

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

      @Jonah Princeton happy to help :D

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

    lol I've done this for years, didn't know it had a name 😂 Nice video, Beau!

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

    Always wondered what this was for..... Could you make a video on 'use strict';? Thanks

    • @freecodecamp
      @freecodecamp  7 ปีที่แล้ว +10

      Ta da! th-cam.com/video/uqUYNqZx0qY/w-d-xo.html

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

      Thanks!

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

    Use Your Code For Good... Thanks Beau.

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

    I think all the variables defined using 'var' are function scope in ES5 not global scope as you said @3:17

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

      I have the same confusion. var a inside function is STILL not polluting the var a that is outside. Why do we need to INVOKE it immediately?

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

    Дякую вам, дуже доступно

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

    For once Beu explains something well in javascript! yaaaay

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

    what a great explanation!

  • @mega_0319
    @mega_0319 7 ปีที่แล้ว +7

    Dude your videos are awesome. Question for you - with ES6, do we need to use IIFE much anymore if at all?

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

      Does anyone have an answer to this?

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

      @Shoaib Bhimani dont modules use IIFE's though?

  • @187hooman
    @187hooman 6 ปีที่แล้ว +24

    Is the video being slightly fast-forwarded while he types?

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

      Yup. 😀

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

      phew! I thought I needed to seriously do a speedtyping course haha

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

      @@JoffreyVerkadeNietVanDeKoekjes Even with Alien type of speed typing you wont be able to do that haha

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

      hollywood level of typing speed lolol

    • @ЯнАлександров-п7н
      @ЯнАлександров-п7н 2 ปีที่แล้ว

      Lm pl

  • @PV_98
    @PV_98 ปีที่แล้ว

    Brilliant!

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

    Thank you!

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

    Thanks!

  • @dzienisz
    @dzienisz ปีที่แล้ว

    What do you think is a real case use of IIFE in a commercial app?

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

    very nice. thanks

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

    well explained!

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

    Great explanation! :-)

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

    // Normal function
    var a = 2
    function display(){
    var a = 3
    console.log("From inside ", a) // 3
    }
    display()
    console.log(a) // 2
    // IIFE
    var a = 2;
    (function(){
    var a = 3
    console.log("From inside ", a) // 3
    })()
    console.log(a) //2
    what's the point here to use IIFE in your example?

  • @guliyevshahriyar
    @guliyevshahriyar ปีที่แล้ว

    thx

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

    why do the first enclosing parenthesis make the function an expression?

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

    What IDE is this? (and the font)
    I love to have a console like the one on the website :D

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

    Where can one get an interactive Javascript console?

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

      if you're using javascript as a web developer you can just link the javascript in your html like: " and then after you open the HTML file with your browser open the Inspector and there must be a Console in the Inspector section; else (if you're not a web dev) I don't know honestly, you can google it.

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

    wowo thnxd😀😀😃😃

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

    I always thought that JS code was interpreted, not compiled.

  • @gigicaly
    @gigicaly 6 ปีที่แล้ว

    what is that js compiler you are using?

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

    Does anyone know how to write JavaScript functions for games (street wars)

  • @andybiersack4906
    @andybiersack4906 ปีที่แล้ว

    #ImmediatelyInvokedFunctionExpression

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

    my favorite number is 7

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

    var a = 2;
    function foo() {
    var a = 3
    console.log(a);
    };
    foo();
    console.log(a);
    foo();
    prints:
    3
    2
    3
    This is different from the thing you said. It is because of es6?

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

      var a = 2;
      // Global scope variable
      function foo() {
      var a = 3
      // Local scope variable
      console.log(a);
      };
      foo();
      // prints Local scope variable which is 3
      console.log(a); // prints Global scope variable which is 2

  • @BnABoAbdAllah
    @BnABoAbdAllah 8 หลายเดือนก่อน

    please don't post a nudity (AWRAH) in your videos or ADs