reverse – Convert number to alphabet letter in JavaScript

thanks for the sample code. On this basis, I will develop my translation of a number into letters. But a question for specialists, how do I find my way back, from letters back to the original number?
thank you very much in advance!

var alphabet = "1456789ABCFGHJKLMNPQRSTUVWXYZ";
var result = "";

function printToLetter(number){
    var ergenis;
    var charIndex = number % alphabet.length;
    var quotient = number/alphabet.length;
    if(charIndex-1 == -1){
        charIndex = alphabet.length;
    result =  alphabet.charAt(charIndex-1) + result;

      ergebnis = result;
        result = "";
return ergebnis;