Despite being a Javascript user for years, there were some things I still didn’t know.
Here are some of the interesting points I found from Ben Cherry’s presentation
names are always hoisted to the top of their scope
and always initialized to undefined
var foo = 1;
(function () {
alert(foo); // undefined
var foo = 2;
}());
alert(foo); // 1
var foo = 1;
(function () {
alert(foo); // alerts "1"
// in the previous example foo is hoisted to the top as "undefined"
}());
alert(foo); // 1
CSS expressions are evaluated right-to-left!
#foo div a {/* ... */}
this starts by looking at every
then it looks for those whose parent is
Popularity: 1% [?]
Category:

