Elastic interview question

What is hoisting in JavaScript and what is it used for?