--- title: String.prototype.toLowerCase() slug: Web/JavaScript/Reference/Global_Objects/String/toLowerCase translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase ---
toLowerCase() 函式会回传将字符串转换为英文小写字母后的结果。
str.toLowerCase()
回传一组将原字串英文内容转换成英文小写字母后的结果。
The toLowerCase() 函式会回传一组将原字符串英文内容转换成英文小写字母后的结果。 toLowerCase() 并不会影响到原字符串 str 的内容值。
toLowerCase()console.log('ALPHABET'.toLowerCase()); // 'alphabet'
| 规范 | 状态 | 注解 |
|---|---|---|
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Initial definition. Implemented in JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.5.4.16', 'String.prototype.toLowerCase')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-string.prototype.tolowercase', 'String.prototype.toLowerCase')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-string.prototype.tolowercase', 'String.prototype.toLowerCase')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.String.toLowerCase")}}