У нас вы можете посмотреть бесплатно 14 Javascript Variable scoping - JavaScript Tutorial 2018 или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Full #Javascript #tutorial for #beginners : http://bizanosa.com/js 14 Javascript Variable scoping - JavaScript for Beginners. This is a Javascript tutorial from scratch for any beginner. Use the above link to watch the full JS video tutorial.. Next Video: • 15 JS Variable scoping example - JavaScri... Previous Video: • 13 JS Variable is null - JavaScript Tutori... Hey, and welcome back. So in the last video we said that we're going to look at variable hoisting. But before that, we need to look at variable scoping. So scoping basically defines how a variable is usable. Is it a local variable or a global variable. A global variable is accessible in the entire document. Any part of the document that you go to, and by document I mean a ‘.js’ file that has lots of JavaScript code. So that's what I'm calling and referring to as a document in this case. So you may find that a document may have functions and may also have something like an ‘if’ block. So in this case, this is an ‘if’ block. So this ‘if’ block has its scope. So the scope of this ‘if’ block ends, it ends where this final closing bracket ends. So, in a normal programming, in other programming languages, if this was the case, this variable would be what is called a local variable. It would only be accessible within this block. That makes it a local variable. But if it was defined outside of this block and outside of any function, it would be a global variable that is accessible by any other function or by any other ‘if’ block or by any other thing that wants to use that variable. As long as it is not defined within a function or within an ‘if’ block or any other kind of block like ‘else’ block, it is a global variable. So JavaScript as you know is a very loose language. And if you use the ‘var’ keyword, this variable will, will be accessible from outside of this block. So the scope of this to some extent is a global variable. If this was something like Java and this was a class, this variable would not be accessible from outside of this block. In Java we have public variables, protected variables and private variables. So unless it was declared as a public variable, it would not be able, it will not be accessible from outside of this block. So I hope you do understand what scoping is. And in the next video, let's look at an example of this. Let's look at an example of this and see how variables are accessible outside of the block. Javascript,web design, js,js tutorial,javascript tutorial, js guide,javascript guide,front end web design,frontend javascript, javascript video tutorials, JavaScript for Beginners GET SOCIAL WITH ME: FACEBOOK: / rwahowa INSTAGRAM: / rwahowa TWITTER: / rwahowa VIMEO: https://vimeo.com/bizanosa/ WEBSITE : http://rwahowa.com