← Back to challenges

Capitalize the Last Letter

JavaScriptHardstringsformattinglanguage_fundamentals

Instructions

Create a function that capitalizes the last letter of every word.

Examples

capLast("hello") ➞ "hellO"

capLast("My Name Is Innokodakademija") ➞ "MY NamE IS Innokodakademija"

capLast("HELp THe LASt LETTERs CAPITALISe") ➞ "HELP THE LAST LETTERS CAPITALISE"

Notes

There won't be any cases of punctuation in the tests.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.