Avoid Polluting The Global Namespace in JavaScript

In this blog post I will show how to avoid polluting the global namespace in JavaScript.

What is this namespace you speak of?

When we give our components names in our code, the interpreter adds them to a namespace. We can reference the component later by using that name. In a certain namespace, a we can only use certain name to reference, or point to, one thing (at a time).

The global namespace is a namespace that is common to all JavaScript code in your JavaScript interpreter. It’s also known as «global scope», and I use the terms loosely and interchangeably here, even though they mean different things.

Continue reading Avoid Polluting The Global Namespace in JavaScript Avoid Polluting The Global Namespace in JavaScript