re: Daily Challenge #95 - CamelCase Method VIEW POST

FULL DISCUSSION
 

Maybe not the best option :) but it works.
JS:

const camelCase = (str) => { if(typeof str !== 'string') { throw 'Not a string'; } return str.trim().toLowerCase().split(' ').map(el => { return el[0].toUpperCase() + el.slice(1); }).join(''); }
code of conduct - report abuse