No block scope. In general you reference enclosing functions and their arguments until you reach the global scope. With is an exception.
This isn&#x2019;t as true in v8.
Referencing a is 4 steps away!
If something isn&#x2019;t defined in the object in your with statement, you create a global. If it is, you overwrite that property. It&#x2019;s difficult to tell from reading the code how an assignment might affect the program.
And you can combine the two!
This avoids a step on the scope chain.
Minimize your code, don&#x2019;t keep functions around that are one-offs. On the other hand, this function is recreated every time.
As always with closures, watch for memory leaks.
• Watch out for closures referencing nodes
• These can leak
• Reference nodes anyway
• Using a reference is much faster than looking up a node
• innerHTML is generally faster than the DOM API