A few sample problems to brush up on Javascript hoisting
After completing this assignment, you should…
- Understand how hoisting works in JavaScript
- Understand that variable declarations are hoisted.
- Understand that function declarations and initializations are hoised.
After completing this assignment, you be able to effectively use
- your brain to translate strange hoisting problems into understandable code.
- A hand written print out of WORKSHEET.md
- Do not run the code until after you have filled in an answer.
- After filling in the answer and then running the code, explain what is going on.
Print out a copy of WORKSHEET.md. Using pen and paper, fill in the answers to each question on the worksheet. After answering each question, run the code to see if you go it correct. Finally, refactor each problem to prevent hoisting from occurring.
Hoisting is a common topic for interview questions, so it's good to brush up on this worksheet before each interview.