https://github.com/kontentino/array-semantic-join
Helper function whose input is an array and output is a semantic string with joined items of the input array.
https://github.com/kontentino/array-semantic-join
array es6 javascript kontentino react react-native semantic-ui
Last synced: about 1 year ago
JSON representation
Helper function whose input is an array and output is a semantic string with joined items of the input array.
- Host: GitHub
- URL: https://github.com/kontentino/array-semantic-join
- Owner: kontentino
- License: mit
- Created: 2019-11-13T08:32:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T05:15:25.000Z (over 3 years ago)
- Last Synced: 2024-10-11T21:58:55.666Z (over 1 year ago)
- Topics: array, es6, javascript, kontentino, react, react-native, semantic-ui
- Language: JavaScript
- Size: 468 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# array-semantic-join by [Kontentino](https://www.kontentino.com/)
[](https://github.com/kontentino/array-semantic-join/actions)
[](https://www.npmjs.com/package/@kontentino/array-semantic-join)
[](https://github.com/kontentino/array-semantic-join/blob/master/LICENSE)
Helper function whose input is an array and output is a semantic string with joined items of the input array.
## Installation
`$ npm install array-semantic-join`
or
`$ yarn add array-semantic-join`
## Usage
```javascript
import arraySemanticJoin from 'array-semantic-join';
...
const userNames = ['John', 'Jane', 'Patrick'];
...
{arraySemanticJoin(userNames)} // output: "John, Jane and Patrick"
{arraySemanticJoin(userNames, { word: 'a' } )} // output: "John, Jane a Patrick"
{arraySemanticJoin(userNames, { word: 'und' } )} // output: "John, Jane und Patrick"
...
```
## Docs
| Function |
|:-------------|
| **arraySemanticJoin**(inputArray: *Array*, options?: { word: String }): *String* |