12 Ways to Create JavaScript Variables

Have you ever wonder how many ways you can create variables in JavaScript? Or in any programming language? To this day, the things that I can do with JavaScript never cease to amaze me; sometimes I’d like to think that they’re magic. In this short article, for my appreciation of the language, I’ll show how to create variables in JavaScript using 12 different methods.

Of course, it’s highly unlikely that you will use most of the examples below in your code, but they work beautifully nonetheless. All of the examples were created in the global execution context and…