diff options
author | Florrie <towerofnix@gmail.com> | 2019-11-14 12:09:21 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-11-14 12:10:10 -0400 |
commit | 7e2ea7b8be7607cc56ffd8a57250e8412a525ce4 (patch) | |
tree | e70a831f92ade5d9821a4e48d8280cd805422b14 /upd8-util.js | |
parent | 85495500e80b84e562a3239d13a110f408989917 (diff) |
art credits & listings + more stuff
Diffstat (limited to 'upd8-util.js')
-rw-r--r-- | upd8-util.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/upd8-util.js b/upd8-util.js index fb2acb67..b36fbc93 100644 --- a/upd8-util.js +++ b/upd8-util.js @@ -27,7 +27,7 @@ module.exports.splitArray = function*(array, fn) { }; // This function's name is a joke. Jokes! Hahahahahahahaha. Funny. -module.exports.joinNoOxford = function(array) { +module.exports.joinNoOxford = function(array, plural = 'and') { if (array.length === 0) { // ???????? return ''; @@ -38,8 +38,8 @@ module.exports.joinNoOxford = function(array) { } if (array.length === 2) { - return `${array[0]} and ${array[1]}`; + return `${array[0]} ${plural} ${array[1]}`; } - return `${array.slice(0, -1).join(', ')} and ${array[array.length - 1]}`; + return `${array.slice(0, -1).join(', ')} ${plural} ${array[array.length - 1]}`; }; |