title: check if elements in array are consecutive --- javascript
body: <p>I have an array as</p>
  
  <pre><code>arr = [1,2,3,4,6,7,8,9]
  </code></pre>
  
  <p>Now I want to check if the values in the array are consecutive.</p>
  
  <p>Being more specific, I want this</p>
  
  <p>First Check gives first and second element are consecutive and the next element is not consecutive then the algo must return the first element from where the consecutive number started</p>
  
  <p>Like </p>
  
  <pre><code>First Check will give 1
  Second Check will give 6
  and so on...
  </code></pre>
  
  <p>Please help
  Thanks in advance</p>