JavaScript Scope (Local vs Global)

Поделиться
HTML-код
  • Опубликовано: 14 май 2018
  • JavaScript Scope (Local vs Global)
    🔥Get the COMPLETE course (83% OFF - LIMITED TIME ONLY): bit.ly/2M1sp4B
    Subscribe for more videos:
    / @programmingwithmosh
    Want to learn more from me? Check out my blog and courses:
    programmingwithmosh.com
    / programmingwithmosh
    / moshhamedani

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

  • @dipanjanmondal221
    @dipanjanmondal221 5 лет назад +3

    Thank you! This is the best explanation i've seen so far and it cleared my doubts. Thanks again .

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

    Thanks Mosh for explaining the difference between Local and Global Scope so well. Well done!!

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

    Best Explanation I've seen about Scopes in Java Script. Thanks Mosh...

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

    thank you vry much you just saved my life when no one could for my final exam :)

  • @alessandroporfirio1910
    @alessandroporfirio1910 6 лет назад

    Thank you for the video! Your explanations are very good. It would be awesome if the videos covering these fundamental aspects of JS were longer.

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

    That was direct to the point thank you sir!

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

    Thanks
    Very simple and great teaching 😃

  • @YTEEsenior
    @YTEEsenior 6 лет назад

    So if global variables are bad, then how do you deal with async functions with callback and you need the result object?

  • @ayrtons1572
    @ayrtons1572 5 лет назад

    thank youuuuu! Helped soo much :)

  • @rohil3023
    @rohil3023 4 года назад

    This was helpful thanks a Ton :)

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

    You sure are good at explaining things so that I understand :)

  • @nextrie
    @nextrie 5 лет назад +3

    What I learnt: A global variable is like a toothbrush. Nah, kidding. Though I already know about scope, you did a great job there.

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

    Thank you so much for this video

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

    All I got, was "we get high on the console" 0:18 🚬

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

    May Allaah bless you, brother Mosh ! Such an amazing teacher !

  • @chellodise
    @chellodise 5 лет назад

    Thanks for this video:)

  • @anuragkhandelwal9703
    @anuragkhandelwal9703 5 лет назад +9

    I liked the Toothbrush example to make them go away from global variables. :D

  • @mirjalol_shamsiddinov
    @mirjalol_shamsiddinov 9 месяцев назад

    i usually dont comment, u just nailed explaing

  • @golden-dragon1442
    @golden-dragon1442 3 года назад

    Awesome channel!!

  • @AnujSharma-qp8ge
    @AnujSharma-qp8ge 3 года назад

    thanks for video

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

    isn't const stands for constant, and it's value remains the same?

  • @eitisingh6297
    @eitisingh6297 6 лет назад

    Hi nice explanation...but there's a question in my mind...If we can change the value of the global 'const' variable inside a method, then what is the use of const?

    • @anuragkhandelwal9703
      @anuragkhandelwal9703 5 лет назад +3

      because inside method it got a new scope and it has nothing to do with the global const variable, you cannot change the value of any constant variable in a specific scope

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

    Thanks

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

    Local variables are first prioritized over Global variables.

  • @vintagenapkin137
    @vintagenapkin137 8 месяцев назад

    Whats a block tho?

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

    i've been using Codecademy, got stuck, needed some help, i was like oh hey, Mosh! yay. youre a great teacher ty

  • @AlexG-wk3nh
    @AlexG-wk3nh 3 года назад

    what confuses me is that you said you should avoid doing global const but 100% of the tutorials im watching do global const's

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

    👍

  • @ord3n
    @ord3n 5 лет назад

    functiaaaan

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

    Thanks
    Very simple and great teaching 😃