JavaScript Variables in Comparison
Variable Type: Var (old) Declaration: var variableName; Example: function exampleFunction() { var x = 10; var x = 20; // Redeclaration is allowed within the same scope console.log(x); // Outputs 20 } Always Global: Yes Redeclare (+): Allows redeclaration within the same scope. Reassign (+): Allows reassignment after declaration. Scope: Function Hoisted (+): Yes, hoisted […]