728x90
toLowerCase() | toUpperCase()
toUpperCase() 문자열을 대문자로 변경하고, toLowerCase()는 소문자로 변경해준다.
const str1 = "javascript";
const currentStr1 = str1.toUpperCase();
const str2 = "JAVASCRIPT";
const currentStr2 = str2.toLowerCase();
document.querySelector(".sample02_N1").innerHTML = "1";
document.querySelector(".sample02_Q1").innerHTML = "javascript";
document.querySelector(".sample02_M1").innerHTML = "toUpperCase()";
document.querySelector(".sample02_P1").innerHTML = currentStr1;
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' 카테고리의 다른 글
split() (2) | 2022.08.17 |
---|---|
template (2) | 2022.08.17 |
trim() (2) | 2022.08.17 |
indexOf() | lastindexOf() (8) | 2022.08.16 |
slice() | substring() | substr() (7) | 2022.08.16 |
댓글