module.exports = digits => {
  const first = digits[0];

  for (let i = 1; i < digits.length; ++i) {
    if (digits[i] !== first) {
      return true;
    }
  }

  return false;
};

module.exports = digits => {
  const first = digits[0];

  for (const digit of digits) {
    if (digit !== first) {
      return true;
    }
  }

  return false;
};

Refactor index loop to for-of loop