What is the term for where to look for things? - Answers scope
What's the difference between a compiled and interpreted language? - Answers interpreter goes
from top-to-bottom, where compiled languages go through multiple passes through code before
execution.
What's the smallest atomic unit of scope in JS? - Answers function scope
What's one of the most important parts of the first compiler pass? - Answers finding
declarations
What's LHS and RHS? - Answers left-hand side (declaration) and right-hand side (assignment)
What's another way to say LHS and RHS? - Answers target and source
If you're in strict mode, and you assign a value to a variable that hasn't been declared through
the first pass, what happens? - Answers It throws an error because it's not declared.
What is the difference between undeclared and undefined? - Answers undeclared means that
the variable has never been declared. undefined means he was declared, but he has empty value.
undefined should be called uninitialized.
In strict mode, what happens to LHS/RHS references? - Answers They both throw reference
errors.
How do you know if a function is a declaration or expression? - Answers If the 'function' word is
the first word in the statement.
In expressions, how do we normally see them? - Answers anonymous function
If you try to add a named function to a function expression, where can it be referenced? -
Answers only within itself
When you use anonymous function expressions, what are the three pitfalls? - Answers 1. no way
inside function to call yourself. recursion isn't possible.
2. don't play well in debugging. so give it a name.
3. it self documents code. makes code more readable.
What are the two models of scope? - Answers lexical and dynamic scope
What does lexical mean in 'lexical scope'? - Answers It refers to the parsing stage, or 'lexing',
which means compile-time scope.
What's a good way to look at lexical scoping? - Answers It's a building. You start on the bottom
, floor and keep climbing until you reach sky/global scope.
What's another way to look at lexical scope? - Answers nested bubbles
What's the point of an IIFE? - Answers to hide scope
How would the IIFE sound in the runtime anthropomorphic conversation? - Answers I have a
function expression. It's an immediate value. So we reference that and immediately execute it.
It's like an immediate assignment like var = "foo";
Is it good practice to name IIFE? - Answers yes
Why would you name your IIFE? - Answers avoid stack trace debugging searching for
anonymous functions
What keyword is going to allow for block scope? - Answers let
With 'let', does that mean we're always going to use it? - Answers no
What keyword is more flexible, var or let? - Answers var
What types of scoping rules does Javascript have? - Answers lexical scoping.
What are the different ways you can create a new scope? - Answers functions, catch blocks,
curly braces with let keyword
What's the difference between undeclared and undefined? - Answers undeclared means that the
variable hasn't been declared. undefined is a value that means currently void. undefined means
uninitialized.
What does 'hoisting' really mean? - Answers during compile-time, the declarations are handled
and created first.
When assigning one variable to another, then changing another, does the first assignment
change? - Answers yes
What gets hoisting to the top first? - Answers functions
What gets hoisted to the top second? - Answers variable declarations (LHS)
What gets hoisting to the top last? - Answers operations
Instead of thinking about 'hoisting', how should you think about JS code? - Answers as compile-
time code
What will the following output?