Skip to content

Conversation

@timothysu
Copy link

A backwards compatible change to the oxford function to support custom conjunctions (rather than it always being 'and'). Also a change to the readme, as npm run install is now npm install.

items = ['apple', 'orange', 'banana', 'pear', 'pineapple']

// Pick a conjunction (defaults to 'and')
Humanize.oxford(items, null, null, "or")
// "apple, orange, banana, pear, or pineapple"

// Also works with a limit
Humanize.oxford(items, 3, null, "with")
// "apple, orange, banana, with 2 others"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant