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 to install nvm, the Node Version Manager
- Javascript Functions
- How to remove a specific item from an array
- Removing the last element of an array in Javascript
- Truthy and Falsy Values in Javascript
- Javascript Array Concat Method
- Demystifying how 'this' works in Javascript
- Deleting an Item in an Array at a Specific Index
- How to Create the iPhone Interface with Long Press in Javascript
- Javascript Array Every Method