code: function nearestCharBefore(char, str, index) {
    // Find the nearest char index before given index. skip white space strings
    // If not found, return -1
    // eg: nearestCharBefore(',', '1,    2, 3', 4) => 1
    let i = index - 1;
    while (i >= 0) {
      if (str.charAt(i) === char) return i;
      if (!/\s/.test(str.charAt(i))) return -1;
      i -= 1;
    }
    return -1;
  }
docs: Find the nearest char index before given index. skip white space strings
  If not found, return -1
  eg: nearestCharBefore(',', '1,    2, 3', 4) => 1
  @param {string} char - Which char to find
  @param {string} str - The string to to search.
  @index {number} index - From which index start to find
  @