var leter= "trypanosomiasis";
console.log(parseInt(leter));
I tried the code above and the one below
var leter= "trypanosomiasis";
console.log(Number(leter));
None of them seemed to work
var leter= "trypanosomiasis";
console.log(parseInt(leter));
I tried the code above and the one below
var leter= "trypanosomiasis";
console.log(Number(leter));
None of them seemed to work
Not sure if this is what you need. Wrote a one-line function that sums all the character's ascii representation in a string. It splits the string into an array of characters and sum them up...
function sumASCII(inputString){
return inputString.split('').reduce((sum, character)=>{ return sum + character.charCodeAt(0)}, 0);
}
console.log(sumASCII("abcd"));