How to Create a Name-Spaced Object to Avoid Using Global Variables in JavaScript

There are two ways to dynamically add an element to the end of a JavaScript array Sometimes you may need variables that are available to every function in your script. While it is tempting to use global variables to achieve this kind of scope, doing so can cause unpredictable results and spaghetti code. If you create […]