string.toLocaleLowerCase
toLocalLowerCase() ๋ฉ์๋๋ ์์์ locale ๊ณ ์ ์ ์ผ์ด์ค ๋งคํ์ ๋ฐ๋ผ ์ฐธ์กฐ ๋ฌธ์์ด ๊ฐ์ ์๋ฌธ์๋ก ๋ณํํ์ฌ ๋ฐํํ๋ค.
const dotted = 'ฤฐstanbul';
`EN-US: ${dotted.toLocaleLowerCase('en-US')}`; // "EN-US: iฬstanbul"
`TR ${dotted.toLocaleLowerCase('tr')}`; // "TR istanbul"
dotted.toLowerCase() // "iฬstanbul"Syntax
str.toLocaleLowerCase()
str.toLocaleLowerCase(locale)
str.toLocaleLowerCase([locale, locale, ...])Parameters
locale (Optional)
locale ์ธ์๋ locale ๊ณ ์ ์ ์ผ์ด์ค ๋งคํ์ ๋ฐ๋ผ ์๋ฌธ์๋ก ๋ณํํ๋๋ฐ ์ฌ์ฉํ๋ locale์ ๋ณด์ฌ์ค๋ค.
๋ฐฐ์ด์์ ์ฌ๋ฌ locale์ด ์ง์ ๋ ๊ฒฝ์ฐ, best available locale ์ด ์ฌ์ฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ํธ์คํธ ํ๊ฒฝ์ ์คํ์ค์ธ locale์ด๋ค.
Return value
๋ชจ๋ locale ๊ณ ์ ์ ์ผ์ด์ค ๋งคํ์ ๋ฐ๋ผ ํธ์ถ ๋ฌธ์์ด์ ์๋ฌธ์๋ก ๋ณํ๋ ์ ๋ฌธ์์ด
Exceptions
RangeError("์๋ชป๋ language ํ๊ทธ: xx_yy")๋locale์ธ์๊ฐ ์ ํจํ language ํ๊ทธ๊ฐ ์๋ ๊ฒฝ์ฐ ๋ฐ์ํ๋ค.TypeError("locale ์ธ์์ค ์๋ชป๋ ์์")๋ ๋ฐฐ์ด์ ์์๊ฐ ๋ฌธ์์ด type์ด ์๋ ๊ฒฝ์ฐ์ ๋ฐ์ํ๋ค.
Description
toLocaleLowerCase() ๋ฉ์๋๋ ์์์ locale ๊ณ ์ ์ ์ผ์ด์ค ๋งคํ์ ๋ฐ๋ผ ์๋ฌธ์๋ก ๋ณํ๋ ๋ฌธ์์ด ๊ฐ์ ๋ฐํํ๋ค.
toLocaleLowerCase() ๋ฌธ์์ด ์์ฒด์ ๊ฐ์๋ ์ํฅ์ ์ฃผ์ง ์๋๋ค. ๋๋ถ๋ถ์ ๊ฒฝ์ฐ toLowerCase() ์ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋์ง๋ง, ํฐํค์ด์ ๊ฐ์ Unicode์ ๊ธฐ๋ณธ ์ผ์ด์ค ๋งคํ์ ๋ฐ๋ฅด์ง ์๋ ์ผ๋ถ locale์ ๋ค๋ฅธ ๊ฒฐ๊ณผ๊ฐ ๋ ์ง ๋ชจ๋ฅธ๋ค.
Examples
toLocaleLowerCase() ์ฌ์ฉํ๊ธฐ
'ALPHABET'.toLocaleLowerCase(); // "alphabet"
'\u0130'.toLocaleLowerCase('tr') === 'i' // true
'\u0130'.toLocaleLowerCase('en-US') === 'i' // false
let locales = ['tr', 'TR', 'tr-TR', 'tr-u-co-search', 'tr-x-turkish'];
'\u0130'.toLocaleLowerCase(locales) === 'i' // trueLast updated
Was this helpful?