https://github.com/haykam821/alphabetical-group
Alphabetically groups an array of strings.
https://github.com/haykam821/alphabetical-group
alphabetical array sort
Last synced: 2 months ago
JSON representation
Alphabetically groups an array of strings.
- Host: GitHub
- URL: https://github.com/haykam821/alphabetical-group
- Owner: haykam821
- License: mit
- Created: 2018-11-17T18:29:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-11T17:18:49.000Z (over 5 years ago)
- Last Synced: 2025-02-01T16:48:21.262Z (4 months ago)
- Topics: alphabetical, array, sort
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alphabetical Group
[](https://github.com/haykam821/Alphabetical-Group/releases/latest)
[](https://www.npmjs.com/package/alphabetical-group)
[](https://travis-ci.com/haykam821/Alphabetical-Group)Alphabetically groups an array of strings.
## Installation
Install with `npm`:
npm install alphabetical-group
## Usage
First, require the module:
```js
const alphabeticalGroup = require("alphabetical-group");
```Simply input an array of stringable values:
```js
alphabeticalGroup([
"alpha",
"bravo",
"charlie",
"Chestnut",
"yesterday",
]);
```This will return an object that will look like this:
```json
{
"c": [
"Chestnut",
"charlie"
],
"a": [
"alpha"
],
"b": [
"bravo"
],
"y": [
"yesterday"
]
}
```