var
Term side of the Card
Topic: Syntax
Unit title: var
Categories: Syntax, Keyword
Explanation side of the Card
Explanation: The keyword used to declare variables with function scope or global scope, depending on where it's used. Unlike `let` and `const`, which offer block scope, `var` allows redeclaration within the same function or global scope and can lead to unexpected behavior due to its function-wide hoisting.
Browser compatibility:
- The chrome browser supports this feature starting from version 1
- The edge browser supports this feature starting from version 12
- The firefox browser supports this feature starting from version 1
- The safari browser supports this feature starting from version 1
Availability: