From d17fe1d91277769645908c93c2572ef0a3a3ee1d Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Tue, 5 Apr 2022 03:30:59 -0500 Subject: [PATCH] Fixed extra comma on stringified items. --- sports-matcher/client/src/utils/strings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sports-matcher/client/src/utils/strings.js b/sports-matcher/client/src/utils/strings.js index 14f18e1..9a47ab9 100644 --- a/sports-matcher/client/src/utils/strings.js +++ b/sports-matcher/client/src/utils/strings.js @@ -10,7 +10,9 @@ export function grammaticalListString(items, max) { return; } built += item; - built += ", "; + if (index < items.length - 1) { + built += ", "; + } if (index == max - 1) { built += "and "; }