code: function removeLeadingZeros(str) {
    if (typeof str != 'string') throw new Error('in removeLeadingZeros, data type mismatch');
  
    let iNonZero = -1;
    for (let i = 0; i < str.length; i++) {
      if (charToVal(str[i]) != 0) {
        iNonZero = i; // index of the first nonzero digit
        break;
      }
    }
    if (iNonZero > 0) str = str.slice(iNonZero);
    if (iNonZero < 0) return ''; // if 'str' is entirely zeros or is the empty string
      
    return str;
  }
docs: /* Remove the leading zeros from a string.
  *