From 2d49339e952a1b5655c2e355ee00ba0500c345a0 Mon Sep 17 00:00:00 2001 From: Nikhil Nambiar Date: Fri, 20 Jun 2025 07:39:52 -0500 Subject: [PATCH] bring it back --- codewars-6-19-25.js | 17 ----------------- codewars-6-20-25.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 codewars-6-20-25.js diff --git a/codewars-6-19-25.js b/codewars-6-19-25.js index 2b24945..9a3d5a4 100644 --- a/codewars-6-19-25.js +++ b/codewars-6-19-25.js @@ -54,21 +54,4 @@ function solution(str) { } } } -} -/* -Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized (known as Upper Camel Case, also often referred to as Pascal case). The next words should be always capitalized. - -Examples -"the-stealth-warrior" gets converted to "theStealthWarrior" - -"The_Stealth_Warrior" gets converted to "TheStealthWarrior" - -"The_Stealth-Warrior" gets converted to "TheStealthWarrior" -*/ - -function toCamelCase(str){ - return str.split(/[-, _]/).map((el, index) => { - if(index > 0) return `${el[0].toUpperCase()}${el.substr(1, el.length)}` - else return el - }).join('') } \ No newline at end of file diff --git a/codewars-6-20-25.js b/codewars-6-20-25.js new file mode 100644 index 0000000..f682e12 --- /dev/null +++ b/codewars-6-20-25.js @@ -0,0 +1,17 @@ +/* +Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized (known as Upper Camel Case, also often referred to as Pascal case). The next words should be always capitalized. + +Examples +"the-stealth-warrior" gets converted to "theStealthWarrior" + +"The_Stealth_Warrior" gets converted to "TheStealthWarrior" + +"The_Stealth-Warrior" gets converted to "TheStealthWarrior" +*/ + +function toCamelCase(str){ + return str.split(/[-, _]/).map((el, index) => { + if(index > 0) return `${el[0].toUpperCase()}${el.substr(1, el.length)}` + else return el + }).join('') +} \ No newline at end of file