This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am kziv on github. | |
* I am kziv (https://keybase.io/kziv) on keybase. | |
* I have a public key ASAU15Tjxp5xpKHwhWrB1EIMMmG_lSWvt4_yUFLTULaalQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
joinWithConjunction(arr, delimiter, conjunction = 'and', useOxfordComma = true) { | |
switch (arr.length) { | |
case 0: | |
case 1: | |
// Use join behavior for these | |
return arr.join(delimiter); | |
case 2: | |
return arr.join(` ${conjunction} `); | |
default: | |
// We don't use a space between the two to make it work like String.join() |