String.prototype.toLowerCase()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

toLowerCase() 函式会回传将字符串转换为英文小写字母后的结果。

嘗試一下

const sentence = "The quick brown fox jumps over the lazy dog.";

console.log(sentence.toLowerCase());
// Expected output: "the quick brown fox jumps over the lazy dog."

语法

js
str.toLowerCase()

回传值

回传一组将原字串英文内容转换成英文小写字母后的结果。

描述

The toLowerCase() 函式会回传一组将原字符串英文内容转换成英文小写字母后的结果。 toLowerCase() 并不会影响到原字符串 str 的内容值。

范例

使用 toLowerCase()

js
console.log("ALPHABET".toLowerCase()); // 'alphabet'

规范

Specification
ECMAScript® 2025 Language Specification
# sec-string.prototype.tolowercase

浏览器相容性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
toLowerCase

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

參見