« Return to Thread: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

by John Resig :: Rate this Message:

Reply to Author | View in Thread


> I'm all in favor of removing gt/lt/eq in favor of the selector version
> with filter.

That was the original goal, but I actually decided to introduce an
array method into jQuery to solve that problem: .slice(). Now gt/lt/eq
will become:

gt: .slice(Num)
lt: .slice(0,Num)
eq: .slice(Num,1)

Plus slice gives you a ton of extra functionality:
first: .slice(0,1)
last: .slice(-1)
all but first and last: .slice(1,-1)

--John

 « Return to Thread: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

LightInTheBox - Buy quality products at wholesale price!