How to get character code (ASCII and Unicode) in Node.js

2 Answers

0 votes
const ch = 'b';

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




/*
run:

98

*/

 



answered Jan 21, 2023 by avibootz
0 votes
const ch = 'b';

const char_code = ch.charCodeAt(0);

console.log(char_code);




/*
run:

98

*/

 



answered Jan 21, 2023 by avibootz
...