How to get character code (ASCII and Unicode) in TypeScript

2 Answers

0 votes
const ch: string = 'a';

console.log(ch.charCodeAt(0));





/*
run:

97

*/

 



answered Jan 21, 2023 by avibootz
0 votes
const ch: string = 'a';

const char_code: number = ch.charCodeAt(0);

console.log(char_code);





/*
run:

97

*/

 



answered Jan 21, 2023 by avibootz
...