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 GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
toLowerCase |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.