Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Array #sortBy short

#233

You could make it shorter and probably faster if replace the following thing

a.value > b.value ? 1 : a.value == b.value ? 0 : -1;

// shorter would be just like that
a.value - b.value;

Reported by MadRabbit · April 28th, 2010 @ 10:00 PM

State: resolved
Milestone: 2.0.0 Release
Assigned to: nobody

Activity

  1. MadRabbit
    MadRabbit
    • State changed from new to invalid

    Unfortunately it doesn't work with strings

    May 22nd, 2010 @ 05:09 PM

  2. MadRabbit
    MadRabbit
    • State changed from invalid to resolved

    found another, more compact solution

    May 22nd, 2010 @ 05:29 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.