JS how to optimize function that finds the text value in gematria Hello guys i wrote this function code: 

function gematria(text){
  var newText = text.toLowerCase(); // handle capital letters
  var startValue=0; //initialize value to zero
  for(let i=0 ; i&lt;newText.length; i++){ // loop through every letter on the text
    let currentCharValue = newText.charCodeAt(i) - 96; // get the distance from the 'a'
    startValue +=currentCharValue;
  }
  return startValue
}

gematria("someText");


it works well but is there any way to do it more short? or better? how good is that code for doing the task?
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"));