Skip to content

Instantly share code, notes, and snippets.

@AitorAlejandro
Created November 2, 2021 10:14
Show Gist options
  • Save AitorAlejandro/7e9fbe1a43038c5aa24563969c43c39c to your computer and use it in GitHub Desktop.
Save AitorAlejandro/7e9fbe1a43038c5aa24563969c43c39c to your computer and use it in GitHub Desktop.
isDenseArray to check if the array doesn't have any hole inside
function isDenseArray(array) {
for (let index = 0; index < array.length; index++) {
if (!(index in array)) {
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment