From 459400775b3dcf1931cba9d2e92cd312586a8640 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 7 May 2025 11:16:56 -0400 Subject: [PATCH] Implement helper function and title-case the tutorials --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0b1c8065b..93e9a61a9 100644 --- a/index.js +++ b/index.js @@ -12,5 +12,13 @@ const tutorials = [ ]; const titleCased = () => { - return tutorials + return tutorials.map(tutorial => toTitleCase(tutorial)); +} + + +const toTitleCase = (words) => { + return words + .split(' ') + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); }