Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js reverse str case

//Reverse the Case
function reverseCase(str) {
	return str.replace(/./g, c => c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase());
}
console.log(reverseCase("Happy Birthday"));	// "hAPPY bIRTHDAY"
console.log(reverseCase("MANY THANKS"));	// "many thanks"
console.log(reverseCase("sPoNtAnEoUs"));	// "SpOnTaNeOuS"
Comment

js reverse string

const reversString = (s="") => s.split().reverse().join();
Comment

PREVIOUS NEXT
Code Example
Javascript :: js push params to url 
Javascript :: find difference in array of objects javascript 
Javascript :: getelementbytagname javascript 
Javascript :: javascript stringify an object 
Javascript :: react map 
Javascript :: javascript check if string ends with 
Javascript :: Could not resolve dependency: npm ERR! peer reac 
Javascript :: jest mongoose multiple connections 
Javascript :: create folder by commend line 
Javascript :: refresh div jquery 
Javascript :: javascript absolute import 
Javascript :: angular 9 how to get previous state 
Javascript :: javascript separate words by capital letter 
Javascript :: how to make an express server 
Javascript :: express post body 
Javascript :: jquery on checkbox checked es6 
Javascript :: or in js 
Javascript :: fakepath 
Javascript :: json user data file sample 
Javascript :: javascript to convert rgb to hsl 
Javascript :: javascript random alphabet 
Javascript :: sorting disable in datatable bootstrap 
Javascript :: file name without extension javascript 
Javascript :: convert csv to json python using pandas 
Javascript :: how to get utc time in angular 
Javascript :: get value of span jquery 
Javascript :: faker.js lorem 
Javascript :: javascript remove all child elements 
Javascript :: javascript iterate array 
Javascript :: H. Nazmul 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =