From 7e2ea7b8be7607cc56ffd8a57250e8412a525ce4 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 14 Nov 2019 12:09:21 -0400 Subject: art credits & listings + more stuff --- upd8-util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'upd8-util.js') diff --git a/upd8-util.js b/upd8-util.js index fb2acb6..b36fbc9 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]}`; }; -- cgit 1.3.0-6-gf8a5