JavaScript

June 10, 2023

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

Tags:

by : Nehal Akhtar

Quick Summary:

Ascii Table in Uppercase Using array.push in JavaScript copy let arr = []; for (let i = 65; i