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(''); }
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.
re: Daily Challenge #95 - CamelCase Method VIEW POST
FULL DISCUSSIONMaybe not the best option :) but it works.
JS: