Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

codewars js Find the first non-consecutive number

function firstNonConsecutive(arr) {
  for (let i = 0; i < arr.length - 1; ++i) {
    if (arr[i] + 1 !== arr[i + 1]) {
      return arr[i + 1]
    }
  }
  return null
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: sort object by value javascript 
Javascript :: js fullscreen 
Javascript :: empty textarea using jquery 
Javascript :: discord.js mention regex 
Javascript :: google charts hide legend 
Javascript :: foreach selector in jquery 
Javascript :: how to update angular version 
Javascript :: typescript round 
Javascript :: how to fill false into array javascript 
Javascript :: react function with form 
Javascript :: ajax error get output 
Javascript :: batch md 
Javascript :: JS class for each 
Javascript :: alert ok with link 
Javascript :: javascript regex for usernames 
Javascript :: leap year condition in javascript 
Javascript :: js nwe date today 
Javascript :: how to generate random character from an array js 
Javascript :: js create events in for always gets last id 
Javascript :: jasmine check if service was called only once 
Javascript :: useeffect not working with react-dom-router 
Javascript :: regex for accepting mobile number only in 10 digit 
Javascript :: javascript find all href with same value 
Javascript :: disable all buttons jquery 
Javascript :: javascript removing item from array 
Javascript :: lua manifest code 
Javascript :: sort and split js alefbethic 
Javascript :: sin in javascript 
Javascript :: js revers string fucntion 
Javascript :: regular expression start and end with same character javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =