Skip to content

Bug in sort function of usage example #2

@urraka

Description

@urraka

Not a big problem but it can be misleading. The sort function should return a value less than 0 when a goes before b, 0 when equal, and greater than 0 when a goes after b.

A correction could be something like this:

blocks.sort(function(a,b) { return (b.h - a.h); });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions