« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/upd8-util.js
diff options
context:
space:
mode:
Diffstat (limited to 'upd8-util.js')
-rw-r--r--upd8-util.js6
1 files changed, 3 insertions, 3 deletions
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]}`;
 };