1.0.5 • Published 7 years ago

join-with-commas-and-and-before-the-last v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

Join items with commas and "&" before the last item

Install

npm install join-with-commas-and-and-before-the-last --save

Method

separate(array)
separate(array, "and") // last item join with 'and'. Default is '&'

Example

var separate = require('join-with-commas-and-and-before-the-last').separate;

Separator.separate(["Emran", "Rayhan", "Mahmud"]);   // output will be "Emran, Rayhan & Mahmud"

Separator.separate(["Emran", "Rayhan"]);             // output will be "Emran & Rayhan"

Separator.separate(["Emran", "Rayhan"], ',');             // output will be "Emran, Rayhan"

Separator.separate(["Rayhan"]);                      // output will be "Rayhan"

Separator.separate(["Emran", "Rayhan", "Mahmud"], 'and');   // output will be "Emran, Rayhan and Mahmud"
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago