Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is the solution for Codewars' KATA: Find the First Non-Consecutive Numbers
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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.