Javascript

toUpperCase(), toLowerCase()

근혁 2022. 4. 17. 22:34

toUpperCase()

문자열 대문자 변경 : 반환(문자열)

{
    const str1 = "javascript";
    const currentStr1 = str1.toUpperCase();

    //결과값 : JAVASCRIPT
}

toLowerCase()

문자열 소문자 변경 : 반환(문자열)

{
    const str2 = "JAVASCRIPT";
    const currentStr2 = str2.toLowerCase();
    
    //결과값 : javascript
}