Three Techniques for Avoiding Global Variables in JavaScript Using Closure

preview_player
Показать описание
Three techniques are presented for avoiding the creation of unnecessary global variables in JavaScript. Using closure this tutorial presents a simple function to change JavaScript variable scope, an immediately invoked function expression (IIFE), and a global object.

For a complete list of all our tutorials:

Take the Learn Modern JavaScript: Getting Started or the Learn Modern JavaScript: Advanced Topics courses at a huge discount:
Рекомендации по теме
Комментарии
Автор

Dude, this was so helpful and clear to understand. Thanks!

Lplaying
Автор

Really very useful, well explained and illustrated.

andrewmiller
Автор

This was a ton of help! I'm new to the global scope is not safe concept—I watched this 3 times. Thanks!!

finalsecretofchrono
Автор

Best JS channel, simple and effective

amguruprasath
Автор

Sir in the thumbnails I see the numbers 3, 5, 1...etc on the left-hand side what do these numbers indicate? I have taken your course and I don't find these videos in your course? Are these videos youtube exclusive? or a part of a course if so which course?

amguruprasath