Are var variables hoisted with their value in JavaScript?
No. var variables are hoisted with undefined. Only the declaration is hoisted; the assignment happens during the code execution phase when the line is reached.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in What Is Hoisting in JavaScript?
Still have questions?
Browse all our FAQs or reach out to our support team
