728x90
반응형
toUpperCase() / toLowerCase()
toUpperCase()는 문자열을 대문자로 변경하고
toLowerCase()는 문자열을 소문자로 변경합니다.
const str1 = "javascript";
const currentStr1 = str1.toUpperCase();
document.querySelector(".sample02_N1").innerHTML = "1";
document.querySelector(".sample02_Q1").innerHTML = "javascript";
document.querySelector(".sample02_M1").innerHTML = "toUpperCase()";
document.querySelector(".sample02_P1").innerHTML = currentStr1;
const str2 = "JAVASCRIPT";
const currentStr2 = str2.toLowerCase();
document.querySelector(".sample02_N2").innerHTML = "2";
document.querySelector(".sample02_Q2").innerHTML = "JAVASCRIPT";
document.querySelector(".sample02_M2").innerHTML = "toLowerCase()";
document.querySelector(".sample02_P2").innerHTML = currentStr2;
728x90
반응형
'javascript' 카테고리의 다른 글
JavaScript charAt(), charCodeAt() (3) | 2022.08.22 |
---|---|
JavaScript match() (3) | 2022.08.22 |
JavaScript trim() / trimStart() / trimEnd() (2) | 2022.08.17 |
JavaScript concat() (2) | 2022.08.17 |
JavaScript replace() / replaceAll() (3) | 2022.08.17 |