function isNoOperandBefore(string, index) {
  const before = string.substring(0, index).trim();

  return before.length === 0 || before.search(/[({,]&/) !== -1;
}
Checks if there is no operand before the current char
In other words, the current char is at the start of a possible operation,
e.g. at the string start, after the opening paren or after a comma

@param {String} string - the input string
@param {Number} index - current char's position in string
@return {Boolean}