showing results for - "js reverse str case"
Veronica
18 Aug 2016
1//Reverse the Case
2function reverseCase(str) {
3	return str.replace(/./g, c => c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase());
4}
5console.log(reverseCase("Happy Birthday"));	// "hAPPY bIRTHDAY"
6console.log(reverseCase("MANY THANKS"));	// "many thanks"
7console.log(reverseCase("sPoNtAnEoUs"));	// "SpOnTaNeOuS"