Emphasise the Words

Published by bangyen in

The challenge is to recreate the functionality of the titlecase() method into a function called emphasise(). The titlecase() method capitalises the first letter of every word and lowercases all of the other letters in the word.

Examples

emphasise("hello world") ➞ "Hello World"

emphasise("GOOD MORNING") ➞ "Good Morning"

emphasise("99 red balloons!") ➞ "99 Red Balloons!"

Notes

You won't run into any issues when dealing with numbers in strings.

Watch a quick demo on how Edabit works.