ASCII TABLE IN LOWERCASE IN JAVASCRIPT

Ascii Table in Lowercase Using array for loop in JavaScript


let arr = [];
// Defined variable arr

for (let i = 97; i <= 122; i++) { 
// Create a variable named i in the for loop, start the value 
// of i from 97 and run it till 122 with the help of i++

  console.log(i + "  =  " + String.fromCharCode(i));
// Now we see that the ascii value is being printed
// from number 97 till number 122 (Lowercase a to z).
}

Output


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

ASCII TABLE IN UPPERCASE IN JAVASCRIPT

Ascii Table in Uppercase Using array.push in JavaScript


let arr = [];
for (let i = 65; i <= 90; i++) { 
// ran the for loop from 65 to 90 

arr.push(String.fromCharCode(i));
// convert to letter to number in array.push in JavaScript
}
console.log(arr);
// Now we see that the ascii value is being printed
// from number 65 till number 90 (Uppercase A to Z).

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'
]