How to get the ASCII value of a character in JavaScript

1 Answer

0 votes
const ch = 'a';

const ascii_value = ch.charCodeAt(0);

console.log(ascii_value);
  
    
  
  
/*
run:
    
97
    
*/

 



answered Dec 31, 2020 by avibootz
...