How to change a String's Case in JavaScript


Strings can be capitalized using String.toUpperCase
For instance;

const str = 'John swana'

str.toUpperCase()

// 'JOHN SWANA'


String.toLowerCase turns strings to their small letters or 'lowerCase'


const strr = "Lorem ipsum"
strr.toLowerCase()

// lorem ipsum

Numbers are not converted, they remain constant, untouched and unchanged.


'65'.toLowerCase()

// '65'

Comments

Popular posts from this blog

JavaScript introduction to variables

Solutions to blocked URLs on Facebook

How to set content disposition headers for express nodejs apps

How to stop moz dotbot from accessing your website

How to set content disposition header for nginx server to force content download