Javascript generates uppercase and lowercase letters.
The str. charCodeAt () and String. fromCharCode () methods are mainly used.
-- Uses charCodeAt () to obtain the Unicode encoding of a specific character in a string.
-- FromCharCode () can accept one or more specified Unicode values, and then return the corresponding string.
// Generate the Unicode value of uppercase letter A as 65 function generateBig_1 () {var str = []; for (var I = 65; I <91; I ++) {str. push (String. fromCharCode (I);} return str;} // generate the Unicode value of uppercase letter a as 97 function generateSmall_1 () {var str = []; for (var I = 97; I <123; I ++) {str. push (String. fromCharCode (I);} return str;} // convert the string to the Unicode code function toUnicode (str) {var codes = []; for (var I = 0; I <str. length; I ++) {codes. push (str. charCodeAt (I);} return codes;} function generateSmall () {var ch_small = 'a'; var str_small = ''; for (var I = 0; I <26; I ++) {str_small + = String. fromCharCode (ch_small.charCodeAt (0) + I);} return str_small;} function generateBig () {var ch_big = 'a'; var str_big = ''; for (var I = 0; I <26; I ++) {str_big + = String. fromCharCode (ch_big.charCodeAt (0) + I);} return str_big;} console. log (generateBig (); console. log (generateSmall (); console. log (toUnicode (generateBig (); console. log (toUnicode (generateSmall (); console. log (generateBig_1 (); console. log (generateSmall_1 ());
Available results --"
FromCharCode plays a major role in html object character conversion.