rgrove/jquery-yui3-rosetta-stone — Issue #14: Erroneus example for jQuery's `$( ... ).each`
Author: yuchi
Created: 2011-11-04 12:35:51+00:00
State: open

From the actual example:

``` javascript
// jQuery

$('.foo').each(
function() {
this.some_method();
}
);

// YUI

Y.all('.foo').each(
function() {
this.some_method();
}
);

```

Should be:

``` javascript
$('.foo').each(
function() {
$(this).some_method(); // notice the wrapped `this`
}
);
```

While `this` in the traverser in YUI is a Node object, in jQuery is the actual HTMLElement! Not only the example should be edited, but a little note IMO is required.