← Back to challenges

Reverse the Case

JavaScriptHardstringsformattingloops

Instructions

Given a string, create a function to reverse the case. All lower-cased letters should be upper-cased, and vice versa.

Examples

reverseCase("Happy Birthday") ➞ "hAPPY bIRTHDAY"

reverseCase("MANY THANKS") ➞ "many thanks"

reverseCase("sPoNtAnEoUs") ➞ "SpOnTaNeOuS"

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Maximum Possible Total