Upstack interview question

Basic js stuff. Closures, hoisting etc.