The answer
Because the variable is hoisted with undefined (with var). Calling undefined() throws TypeError: x is not a function. Only function declarations are hoisted with their body.
Because the variable is hoisted with undefined (with var). Calling undefined() throws TypeError: x is not a function. Only function declarations are hoisted with their body.
Browse all our FAQs or reach out to our support team
Your learning library
Find your next course. Build something great.