"ABC".charCodeAt(0) // returns 65
'a'.charCodeAt(0)//returns 97, where '0' is the index of the string 'a'
word = userInput[0]; //abc
var sum =0;
for(i=0;i<word.length;i++)
{
sum = sum + word.charCodeAt(i);
}
console.log(sum); //294
var x = 'B';
var ascii_code = x.charCodeAt(0);
console.log(ascii_code);
String.fromCharCode(65,66,67); // returns 'ABC'
const vowels = []
for (let i = 1; i <= 26; i++) {
let values = i - 1
let keys = 64 + i
if (values <= 25) {
vowels.push({ [`${String.fromCharCode(keys)}`]: values })
}
}