Array to a better string.
$ npm install --save grammarray
const grammarray = require('grammarray');
const arr = ['Marvin Gaye', 'Led Zeppelin', 'Bigge'];
grammarray(arr);
//=> 'Marvin Gaye, Led Zeppelin and Biggie'
grammarray(arr, {
before: '~~ ',
delimiter: ' and ',
lastDelimiter: 'but also',
after: ' ~~'
});
//=> '~~ Marvin Gaye and Led Zeppelin but also Biggie ~~'
MIT © David Öhlin