re: Daily Challenge #95 - CamelCase Method VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Here comes a naive oneliner: camel=s=>s.split` `.map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join`` For every word, it uppercas...
 

Nice one liner :). But if s is an empty string, then str[0] will be undefined and toUpperCase will throw an error.

 

It's not about finding edge cases. This is a great solution for a coding challenge... Most coding challenges are things you'd put in production anyways

code of conduct - report abuse