Can you explain your question a bit more clearly? Yes, it's true that
the `thisArg` argument to `Enumerable#find` is the second argument,
and it's also true that the `thisArg` argument to `Function#bind` is
the first argument, but it's unclear what you're really asking.
Also note that you don't need `bind` in your sample code at all,
because your iterator function is already a closure. So just
var mtedit = this.MeetEdits.find(function(item) {
return item.meetid == formid;
});
...because the function can use the `formid` variable from the
containing scope (I know it's there because you were passing it into
`bind`).
(I used `item` rather than `mtedit` as the function argument name to
avoid confusion with the `mtedit` variable in the containing scope.)
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Aug 9, 7:43 pm, kstubs <[email protected]> wrote:
> Why, when I bind like this is "this" the 2nd argument (expecting it to be
> first argument) in the find function?
>
> var mtedit = this.MeetEdits.find(function(mtedit,formid) {
> return mtedit.meetid == formid;
> }.bind(this, formid));
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.