JS how to optimize function that finds the text value in gematria
The shortest approach is to parse the character with a base of 36 and get the delta of 9 for summing.



function gematria(text) {
    return [...text].reduce((s, c) =&gt; s + parseInt(c, 36) - 9, 0);
}

console.log(gematria("someText"));