Socket
Socket
Sign inDemoInstall

array-join-conjunction

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    array-join-conjunction

Join an array with a conjunction


Version published
Maintainers
1
Install size
4.51 kB
Created

Readme

Source

array-join-conjunction

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Join an array with a conjunction

Install

npm install --save array-join-conjunction

Usage

import arrayJoinConjuction from 'array-join-conjunction'

arrayJoinConjuction([])
// => ''

arrayJoinConjuction([1, 2])
// => '1 and 2'

arrayJoinConjuction(['blue', 'red', 'green'])
// => 'blue, red, and green'

arrayJoinConjuction(['blue', 'red', 'green'], 'or')
// => '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

Keywords

FAQs

Last updated on 31 Jan 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc