JavaScript

12 Ways to Create Variables in JavaScript

In this video, I’ll show you how to create variables in JavaScript using 12 different ways. Chances are you will probably never use most of them in your code, but for the love of coding and because JavaScript lets you do it, we’ll explore its capabilities.

#1. Using let
#2. Using const
#3. Using var
#4. Using no keyword (globally)
#5. Using globalThis keyword
#6. Using this keyword
#7. Using window keyword
#8. Using window’s constructor’s prototype property
#9. Using this constructor’s prototype property
#10. Using this constructor’s prototype property
#11. Using object instance __proto__
#12. Using object literal __proto__

JavaScript
Verified by MonsterInsights