Javascript
Javascript toLowerCase() - Convert Strings to Lowercase
📣 Sponsor
a String
is a type of data in Javascript, and as with any other type of data, String
s have prototypes and therefore inherit standard methods. One of these methods is toLowerCase()
, which you’ll often see written as String.prototype.toLowercase()
. This method turns any string from any case to just lowercase instead.
Here is a quick example:
let myString = 'HELLO WORLD'
console.log(myString.toLowerCase()) // hello world
This will work on anything which is of string type - so trying to initiate a new String()
and use this method also works:
let myString = new String('HELLO!')
console.log(myString.toLowerCase()) // hello!
Last Updated 1675543167736
More Tips and Tricks for Javascript
- How JSON works in Javascript
- How to get the Full URL in Express on Node.js
- Javascript Ordinals: Adding st, nd, rd and th suffixes to a number
- Making your own Email Subscription Service with Node.JS
- Javascript Errors
- Sharing Screens with the New Javascript Screen Capture API
- How to Change Node.js Version
- How to use Environmental Variables in NodeJS
- Javascript Types
- How to sort an array by date in Javascript