Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions codewars-6-19-25.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('')
}
17 changes: 17 additions & 0 deletions codewars-6-20-25.js
Original file line number Diff line number Diff line change
@@ -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('')
}