Skip to content

lamansky/shortest-first

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shortest-first

Sorts items in ascending order of length.

Installation

Requires Node.js 6.0.0 or above.

npm i shortest-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 shortestFirst = require('shortest-first')

shortestFirst(['example', 'test']) // ['test', 'example']

// Supports the bind operator
['example', 'test']::shortestFirst() // ['test', 'example']

About

[Node.js] Sorts items in ascending order of length.

Resources

License

Stars

Watchers

Forks

Packages

No packages published