See this variable comparison below? I've seen it shared in a few places. Problematic thing about it is that a lot in it is incorrect. Please always double check information before you believe it.

THREAD

#100daysofcode #codenewbies #freecodecamp #tech #javascript #programming
A variable is function scoped or block scoped, not both. Var is function scoped, let and const are block scoped. Vars are only added to a global object if they are defined in the global scope...
If you define a variable with the 'var' keyword in a nested scope then it won't be stored in the global scope. Lastly, all var, let, and const are hoisted. The thing is that for the last two an error will be thrown if they are used before initialisation...
You can follow @thomasfindlay94.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: