longest-first

Sorts items in descending order of length.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
longest-first
1.0.06 years ago6 years agoMinified + gzip package size for longest-first in KB

Readme

longest-first
Sorts items in descending order of length.

Installation

Requires Node.js 6.0.0 or above.
npm i longest-first

API

The module exports a single function.
  • Parameter: items (iterable): Values that should be sorted by their length property. (The original iterable is not modified.)
  • Return Value: Array

Example

const longestFirst = require('longest-first')

longestFirst(['one', 'two', 'three']) // ['three', 'one', 'two']

// Supports the bind operator