Second arguments for Array.prototype.sort: map function

Peter Michaux petermichaux at
Thu Feb 23 18:12:49 PST 2012

On Mon, Feb 20, 2012 at 11:52 AM, Xavier MONTILLET
< at> wrote:

> what I would like is to be able to do this:
> var sortedArray = array.sort( compare, f );

I think the above is not very readable.

The following is more readable and shows the order in which the more
modular parts are being applied.

var sortedArray =;


More information about the es-discuss mailing list