JavaScript Program ASCII code to Character

JavaScript

In this post, we will learn about a JavaScript Program to convert ASCII code to Character that includes ASCII code to characters uppercase and JavaScript Program to Convert Number to letter lower case.

1. JavaScript Program ASCII code to charcaters uppercase


The upper case letter ASCII value range starts from 65 to 90. We are using for loop that starts at 65 value of letter A and so on and ends at 90 value of letter Z.

  • The javascript fromCharCode() method changing num value to charcater and appending to Str.After loop end we are printing the result using console.log(str);
  • We have also passed multiple sequence values to fromCharCode( ) to print a word

JavaScript Example to numbers to Letters

var str = "";
for (let num = 65; num <=90 ; num++)
{
 
 let char = String.fromCharCode(num);
 str += char + ", ";
}

console.log(str);



let char = String.fromCharCode(68, 69, 86, 69, 78, 86, 77);
 
 
console.log(char)


//sequence of mutiple number value
let letter = String.fromCharCode(68, 69, 86, 69, 78, 85, 77);
 

 
console.log(letter )


Output

A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,

DEVENUM

2. JavaScript Program ACSII to charcater lower case


The lower case letter ASCII value range starts from 97 to 122. It starts at 97 value of letter a and so on and end at 122 value of letter z.

JavaScript Program Number to letter lower case

var str = "";
for (let num = 97; num<=122 ; num++)
{
 
 let char = String.fromCharCode(num);
 str += char+"  -  "+num+"\n "
}

console.log(str)

Output

a  -  97
 b  -  98
 c  -  99
 d  -  100
 e  -  101
 f  -  102
 g  -  103
 h  -  104
 i  -  105
 j  -  106
 k  -  107
 l  -  108
 m  -  109
 n  -  110
 o  -  111
 p  -  112
 q  -  113
 r  -  114
 s  -  115
 t  -  116
 u  -  117
 v  -  118
 w  -  119
 x  -  120
 y  -  121
 z  -  122