Why should I avoid var?
var can lead to unexpected behavior due to function scope and hoisting.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in What Is the Difference Between var, let, and const?
Still have questions?
Browse all our FAQs or reach out to our support team
