JavaScript String toLowerCase()


In this tutorial, we will learn about the JavaScript String toLowerCase() method with examples.

The JavaScript String toLowerCase() method converts the string into lowercase and returns a new string.

toLowerCase() Example

// JavaScript Program to illustrate toLowerCase() function


// convert uppercase to lowercase
const lowerCaseText = text.toLowerCase();

// Output: welcome to javascript world

toLowerCase() Syntax

The syntax of the JavaScript toLowerCase() method is as follows.


Here the str is the string or the string variable.

toLowerCase() Parameter

The JavaScript toLowerCase() method does not accept any arguments.

toLowerCase() Return Value

The toLowerCase() method converts the given string into lowercase and returns it as a new string. The original string value remains unaffected.

Note: The toLowerCase() method raises TypeError when called on null or undefined.

Example: JavaScript Convert string from uppercase to lowercase

// JavaScript Program to illustrate toLowerCase() function

const text1 = "HELLO WORLD";
const text2 = "JAvAsCRIpt iS FuN";



hello world
javascript is fun
Leave a Reply

Your email address will not be published. Required fields are marked *

Sign Up for Our Newsletters

Get notified on the latest articles

You May Also Like
JavaScript String endsWith()

JavaScript String endsWith()

Table of Contents Hide endsWith() SyntaxendsWith() ParametersendsWith() Return ValueJavaScript String endsWith() examplesJavaScript endsWith() example with length parameter In JavaScript, the endsWith() method determines whether the given string ends with a…
View Post
JavaScript Anonymous Functions

JavaScript Anonymous Functions

Table of Contents Hide Anonymous Functions Syntax Example 1: Anonymous Functions in JavaScriptExample 2: Anonymous Functions with arguments in JavaScriptExample 3: Using anonymous functions as arguments of other functionsExample 4: Immediate…
View Post