Support Online
Skip to main content

toLowerCase() and toUpperCase() Methods in JavaScript

The toLowerCase() and toUpperCase() methods, when used on a string, return the same string but change all letters to lowercase or uppercase:

var tutarsiz = "rAbisU'yA HoŞgelDinİZ..";

console.log(tutarsiz.toLowerCase());

// "rAbisU'yA HoŞgelDinİZ.." → tüm harfler küçük hale gelir

Syntax

// Küçük harfe çevirme
myString.toLowerCase();

// Büyük harfe çevirme
myString.toUpperCase();

Usage Notes

These methods work especially well for string comparisons because you can ignore case differences and just focus on the words themselves.

Of course, in some cases you need to check the capitalization of letters, but these methods make it easier when you don't.

var yazitipi= "Sans-serif";

console.log(yazitipi.toLowerCase() == "sans-serif");

// true