16: JavaScript Scopes | Local Scope and Global Scope in JavaScript | JavaScript Tutorial | mmtuts

16: JavaScript Scopes | Local Scope and Global Scope in JavaScript | JavaScript Tutorial | mmtuts

Dani Krossing

6 лет назад

66,429 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Rudy Thorns
Rudy Thorns - 29.12.2022 10:43

The resource heavy stuff is the only thing i dont know. and was new to me, thanks! it was so informative and useful for my visit in your channel

Ответить
Tedy Abr
Tedy Abr - 03.11.2022 13:04

Thank you so much for the fast and easy explanation :) saved me a lot of time :)

Ответить
Ruben Raul Martin
Ruben Raul Martin - 03.11.2022 10:55

Hmm love your plants man! What plants are there ? And also the pots, super nice!

Ответить
holobolo
holobolo - 30.08.2022 03:20

Thanks for the vid but waay too much treble in your vocal mix.

Ответить
Michael Joseph
Michael Joseph - 23.08.2022 06:31

I was just thinking, "oh, in that case I'll create variables outside of the functions!" then I got roasted with some facts about the downsides lol

Ответить
Over
Over - 07.07.2022 15:14

within 2 minute you explained it better than the almighty "yOu DoNT kNOW Js" book... getting a little annoyed at the overcomplicated examples in that book.

Ответить
Queen Sheba
Queen Sheba - 15.05.2022 05:26

thank you! this the only video that showed clear examples and your explanation was clear. Please keep creating content

Ответить
AD
AD - 11.05.2022 23:05

not seeing why the <form> tag was necessary. Great tutorial tho!

Ответить
SatDon
SatDon - 16.02.2022 22:23

bruh thank you this was a breeze amazing teaching abilitys my boy

Ответить
Joseph Nour
Joseph Nour - 15.02.2022 15:51

Nice videos

Ответить
Abdel Majed Muktar
Abdel Majed Muktar - 04.02.2022 22:51

Thank you so much, right now I know what variable scope is and I'm waiting for the next lesson
and thank you again🙏🙏🙏

Ответить
Pali Mali
Pali Mali - 03.02.2022 17:27

Thanks man, 10 times better than Udemy explanation. “You're an amazing teacher !!!

Ответить
cloud
cloud - 01.02.2022 00:11

Thank you. Wasn’t getting what I needed out of my course so stopped in here in order to get some quick info. You cleared up what I needed to know in a matter of minutes. Thumbs up, thank you again!

Ответить
Naveed Ali Rehmani
Naveed Ali Rehmani - 16.10.2021 21:42

5 JavaScript Scopes explained.
1. Global Scope
All other scopes are defined inside of this scope so variable defined here will be available in all other scopes.
2. Local Scope
This can be any scope, for example two variable defined in a Function scope are local to each other.
3. Function Scope
You create a function and it creates a scope, it's that simple, any variable defined here will not be available outside the scope. not even variable defined with var keyword.
4. Block Scope
This scope is created simple by wrapping variable inside {} braces, variable will not be available outside the scope
5. Lexical Scope
Lexical scope means the children scope have the access to the variables defined in the parent scope.

Ответить
Reid Williamson
Reid Williamson - 17.09.2021 08:51

I love the way you explain. Thanks for your videos

Ответить
Sumit Timalsina
Sumit Timalsina - 30.08.2021 12:27

Your vidoes are the best man! Thank you very much. Almost gave up learning JS

Ответить
Jimi1000
Jimi1000 - 01.08.2021 18:20

how to share variables between two functions ?

Ответить
Farid Rzayev
Farid Rzayev - 01.08.2021 16:43

this is outdated topic, as new keyword "let" and "const" added new scope called block scope

Ответить
Robert Kováč
Robert Kováč - 08.07.2021 11:03

thanks !

Ответить
Ameliah Banjoh
Ameliah Banjoh - 18.02.2021 18:21

Thank you so much! I was really confused on this one but this video helped explain it alot. I'm very grateful!

Ответить
ay gg mon
ay gg mon - 16.02.2021 16:19

Instead of console.log you could use return its more professional

Ответить
Tahu Islam
Tahu Islam - 13.02.2021 20:03

You look like Elon Musk!!!

Ответить
Yevgenia
Yevgenia - 22.01.2021 12:11

Thank you!

Ответить
Mário Almeida
Mário Almeida - 03.01.2021 19:14

After watching the video: local scope makes the site heavier only when we call the function. global scope makes the site heavier on load. local scope also cant be used outside of the function? and global scope yeah

Ответить
Chadi El Jamal
Chadi El Jamal - 01.11.2020 19:28

Thank you so much that helped me a lot to understand the different between Global Scope and Local Scope.

Ответить
Usaid ahmed
Usaid ahmed - 11.09.2020 21:26

me n my bro lernt JavaScript from u sir gr8 effert

Ответить
teshay93
teshay93 - 15.08.2020 17:53

You explain things much more clearly than the guys whose course i paid for lol. straight to the point you go and its effective! Thank You!!

Ответить
AceMoisan
AceMoisan - 24.07.2020 22:06

You're intro on the past like 5 videos is the EXACT same and its hilarious its like it was all dubbed over hahahahah

Ответить
onetap23
onetap23 - 19.06.2020 15:37

where is the fox on the shelf from?

Ответить
Nicolas Caillet - Bois
Nicolas Caillet - Bois - 16.06.2020 20:22

10.

Ответить
Codify
Codify - 21.05.2020 03:02

thank you a lot I really appreciate the time you dedicate you are putting in the videos

Ответить
Mr.Penguin
Mr.Penguin - 14.05.2020 11:55

Thanks!!! I recently started learning to code and this helped a lot!

Ответить
Stacey
Stacey - 07.05.2020 14:04

Super clear and helpful. Thank you! Cleared up some confusion on my part.

Ответить
Thomas Waligora
Thomas Waligora - 27.04.2020 17:25

The best JS course on YT!

Ответить
Ray Robinson Gonzaga
Ray Robinson Gonzaga - 25.04.2020 18:24

Hi @mmuts, I have a question about this topic. I created a variable inside if statement (block scope) and tried to access it inside a function (function scope) and it was successful. Are variables declared inside a block scope considered also as declared globally? Or it's just because of hoisting? Thanks more power! Love your tutorials! :)

Ответить
Ihtiyor Vohobjonov
Ihtiyor Vohobjonov - 22.04.2020 08:29

THe Alchemist do you suggest for reading

Ответить
S. Hashib
S. Hashib - 09.04.2020 11:29

Am I the only one who noticed KURAMA??

Ответить
KidBrave_
KidBrave_ - 14.03.2020 03:30

Thank you brotha for putting this video out!. I have been working with functions for a good couple months and hearing this, in the beginning, was super confusing me as I'm a hands-on visual learner but after building a few things on my landing page and seeing functions being used to what I'm looking for hearing global and logical scope makes a lot more sense!. Keep up the great work your content is great. :D

Ответить
Karne West
Karne West - 08.02.2020 05:50

being able to see the instructor is helpful for some odd reason. also, the hand gestures help with the explanation lol great videos

Ответить
Hajar Mekamy
Hajar Mekamy - 15.12.2019 13:25

Thank you so much, I finally understood the global and local scope!

Ответить
Kingsley Atuba
Kingsley Atuba - 21.11.2019 08:04

Best Teacher Ever

Ответить
Ehab Talaat
Ehab Talaat - 07.09.2019 06:04

amazing videos i have a question if i finished that 35 videos of JS i will know every thing about JS or not????

Ответить
cALiBr0
cALiBr0 - 24.06.2019 11:50

you seem really happy about confusing us

Ответить
Abe TT
Abe TT - 30.03.2019 22:05

These videos are just great, thanks man for not being a bad teacher :)

Ответить
Yavor Daskaloff
Yavor Daskaloff - 29.03.2019 13:43

I like how you pronounce "var" as in the Danish "was", and not like a cutout from the word "variable". I live in Denmark and I find this quite funny (in a good way) :D

Ответить
Andy Hernandez
Andy Hernandez - 28.02.2019 06:24

What's the difference between console.log and return statement?

Ответить
Aaron Lee
Aaron Lee - 03.02.2019 05:57

SET A GETS As

Ответить