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 2015年7月.
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® 2026 Language Specification> # sec-string.prototype.tolowercase> |