Mainly used in the Str.charcodeat () and String.fromCharCode () methods
--"Use charCodeAt () to get the Unicode encoding of a specific character in a string.
--"fromcharcode () can accept one (or more) specified Unicode values and return the corresponding string.
//generates an uppercase letter A with a Unicode value offunctiongeneratebig_1 () {varstr = []; for(vari=65;i<91;i++) {Str.push (String.fromCharCode (i)); } returnstr;}//generates a Unicode value of uppercase afunctionGeneratesmall_1 () {varstr = []; for(vari=97;i<123;i++) {Str.push (String.fromCharCode (i)); } returnstr;}//Convert a string to a Unicode codefunctionTounicode (str) {varCodes = []; for(vari=0;i<str.length;i++) {Codes.push (Str.charcodeat (i)); } returncodes;}functionGeneratesmall () {varCh_small = ' a '; varStr_small = ' '; for(vari=0;i<26;i++) {Str_small+ = String.fromCharCode (ch_small.charcodeat (0) +i); } returnStr_small;}functionGeneratebig () {varCh_big = ' A '; varStr_big = ' '; for(vari=0;i<26;i++) {Str_big+ = String.fromCharCode (ch_big.charcodeat (0) +i); } returnStr_big;} Console.log (Generatebig ()); Console.log (Generatesmall ()); Console.log (Tounicode (Generatebig ())); Console.log ( Tounicode (Generatesmall ())); Console.log (generatebig_1 ()); Console.log (Generatesmall_1 () );
Can get results--"
Where fromCharCode plays a significant role in the conversion of HTML entity characters, see above
JS generates 26 uppercase and lowercase letters