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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here comes a naive oneliner:
For every word, it uppercases its first letter and lowercases the following ones
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