title: Validate the first or last consecutive and equal numbers
body: <p>I need to validate that the first two digits of a number which are not consecutive or equal.<br>
  This is for a ReactJS project, using a conditional "for" and "if" to achieve the validation.</p>
  
  <p>I have this code:</p>
  
  <pre><code>for (let i = 0; i &lt; arrayPassword.length - 1; i++) 
  {
      const actual = parseInt(arrayPassword[i])
      const next = parseInt(arrayPassword[i + 1])
  
      //validate consecutive and equal numbers
      let isConsecutive = actual + 1 === next || actual === next ? true : false;
  
      if (isConsecutive) {
        callback(`consecutive and equal numbers are not allow.`);
      } else {
        callback();
      }
  }
  </code></pre>
  
  <p>At this moment I can validate the full expression when I have a 4 digits consecutive or equal, for example: </p>
  
  <pre><code>(1111, 2222, 3333, 1234, 2345, 6789, ...) 
  </code></pre>
  
  <p>and it's ok, but the problem appears when the first two digits are equal or consecutive, for example: </p>
  
  <pre><code>(1147, 2293, 3360, 1244, 6750, 8952, ...)
  </code></pre>
  
  <p>I hope that through a condition the numbers like the previous examples do not enter the conditional If.<br>
  I appreciate the interest in helping me.</p>