array-join-conjunction
Join an array with a conjunction
Install
npm install --save array-join-conjunction
Usage
// => '' // => '1 and 2' // => 'blue, red, and green' // => 'blue, red, or green'
API
arrayJoinConjuction(array, [conjunction])
Returns a string
joined from array
using an optional conjunction
.
array
type: array
The array to join into a string. An empty array returns an empty string.
conjunction
type: string
default: 'and'
A conjunction to join two or more words with. The default is to use 'and'
.
License
MIT © Dustin Specker