Function bySize

  • Compares two values by their size property. Puts the value with the smaller size first.

    Example

    [new Set([0, 1, 2]), new Set([0]), new Set([0, 1])].sort(bySize)
    == [new Set([0]), new Set([0, 1]), new Set([0, 1, 2])];

    Parameters

    • a: { size: number }

      first value

      • size: number
    • b: { size: number }

      second value

      • size: number

    Returns number

Generated using TypeDoc