The concept of globals begins to harden. Any variable outside a function is global, correct? If the variables are contained inside $(document).ready( function() { *code* } ); are considered global?
I found a way to bypass the commonly used array into a function that uses the specified array, but now I essentially use my HTML content as my global ones, if that makes sense (for example, using the text inside the div and passing it into the function). Is this how people usually constantly change / often refer to variables?
If they are not global, should I include variables inside functions to develop good practice?
Tarik source share