Skip to content

sudiptachatterjee/oxford-comma-join

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oxford Comma Join

Easily convert your list of string values into a grammatically correct string. So if your list looks like ["milk", "eggs", "bread", "toilet paper"], then you can directly add it to an output as a single string: "milk, eggs, bread, and toilet paper".

Usage

const oxfordJoin = require(`oxford-comma-join`);
console.log(oxfordJoin([`one`, `two`, `three`, `four`]));
// "one, two, three, and four"

Examples

const oxfordJoin = require(`oxford-comma-join`);
console.log(oxfordJoin([`one`, `two`, `three`, `four`]));
// "one, two, three, and four"

console.log(oxfordJoin([`one`, `two`]));
// "one and two"

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published