[Noisebridge WebDev] [JavaScript Class] Quiz

Garrett Smith dhtmlkitchen at gmail.com
Sun Dec 15 10:18:45 UTC 2013


Hey JavaScripters -

Good job everyone. We made good progress during class last Friday,
specifically, we learned about the Arguments object (not an array!),
FunctionExpression vs FunctionDeclaration, and a much-needed recap on
the Reference type.

Reading the spec really is the key to understanding the language.
Obstinate refusal to do so does not help one advance on the learning
curve.

When I was a child, I read a lot. When reading, I'd keep a dictionary
handy and when I encountered a word I did not know, I would look it
up.

And much in the same way, looking up grammar productions in the
specification helps us to understand how the language actually works,
so that we can read code and know exactly what it will do when run
without having to run it. So that we can write code without having to
resort to copying, mystical incantations, or catering to stupidity*.

Tell me the differences between assignment to an identifier that has
been declared using var and assignment to an identifier that has not
been declared.

alert(x);
var x = 10;

alert(y);
y = 20;

Common misconceptions abound. Don't believe everything you read on
Stack Overflow.

Suggested reading: Kangax' NFE article
http://kangax.github.io/nfe/#expr-vs-decl#activation-object-in-blackberry-browser

* on mystical incatations, coding for stupidity, and recursive
reinvocation of the constructor
https://groups.google.com/forum/#!searchin/comp.lang.javascript/mystical$20incantations$20func%28%29/comp.lang.javascript/nRatLZZCJqI/MCkA5mSY_OYJ
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io



More information about the WebDev mailing list