wpears
Joined 13 years ago
Karma
57
Submissions
21
Member since
Aug 9
Joined 13 years ago
[1] http://www.whitehouse.gov/sites/default/files/omb/memoranda/...
[1] maybe after glancing off a planet or created by the collision of two large objects
function handleClick(i) {
this.innerHTML = i;
}
for (i = 0; i < elems.length; i++) {
elems[i].addEventListener("click", handleClick.bind(this, i));
}
In the for loop, the this value refers to the global object. To get the desired effect, it should be changed to elems[i] (this piece of code is trying to bind a handler to an element).What makes a function either an expression or declaration is simply whether the parser expects an expression or declaration in the given context. The grouping operator '()' and the NOT operator '!' both are parameterized by expressions, and so the Javascript parser treats functions passed to them as expressions. Unless located where an expression is expected, functions will default to declarations.
There isn't necessarily anything nefarious about this, just that it may be incapable of dealing with the enormity of climate climate and also, as OP intimates, there may be a class of solutions that are better/cheaper/more efficient from a policy perspective, but that don't have anyone positioned to gain financially from them and so are harder to garner support for.