> Right, I was assuming correct syntax for #1 (my bad):
As I said, I was assuming he was doing more than just this.bar().
-- T.J.
On May 17, 9:58 pm, Tobie Langel wrote:
> > Isn't closure formed in both #1 and #2 as soon as FunExpr. (passed to
> > `each`) is being evaluated?
>
> Right, I was a
> Isn't closure formed in both #1 and #2 as soon as FunExpr. (passed to
> `each`) is being evaluated?
Right, I was assuming correct syntax for #1 (my bad):
$R(1,2).each(this.bar, this);
which avoids the extra closure altogether.
--~--~-~--~~~---~--~~
You recei
On May 16, 12:51 pm, Tobie Langel wrote:
> FYI, fastest way is #1 as you're avoiding creating a closure
> altogether (just using Function#call internally).
Isn't closure formed in both #1 and #2 as soon as FunExpr. (passed to
`each`) is being evaluated?
[...]
--
kangax
--~--~-~--~~
FYI, fastest way is #1 as you're avoiding creating a closure
altogether (just using Function#call internally).
On May 16, 10:35 am, "T.J. Crowder" wrote:
> Hi,
>
> I don't know that there's any one standard pattern, but here are a
> couple of the more common ones [here I'm assuming that the clos
Hi,
I don't know that there's any one standard pattern, but here are a
couple of the more common ones [here I'm assuming that the closure
will actually do more than just this.bar()]:
1. Specifically when using Enumerable#each[1], it has this handy
second parameter you can use to set the context