Skip to content

haykam821/Alphabetical-Group

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alphabetical Group

GitHub release npm Travis (.com)

Alphabetically groups an array of strings.

Installation

Install with npm:

npm install alphabetical-group

Usage

First, require the module:

const alphabeticalGroup = require("alphabetical-group");

Simply input an array of stringable values:

alphabeticalGroup([
	"alpha",
	"bravo",
	"charlie",
	"Chestnut",
	"yesterday",
]);

This will return an object that will look like this:

{
	"c": [
		"Chestnut",
		"charlie"
	],
	"a": [
		"alpha"
	],
	"b": [
		"bravo"
	],
	"y": [
		"yesterday"
	]
}

About

Alphabetically groups an array of strings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published