JavaScript Program to Find ASCII Value of Character

bookmark

// program to find the ASCII value of a character

// take input from the user
const string = prompt('Enter a character: ');

// convert into ASCII value
const result = string.charCodeAt(0);

console.log(`The ASCII value is: ${result}`);

 

 

 

Output

Enter a character: a
The ASCII value is: 97