Skip to content

Instantly share code, notes, and snippets.

@martinsson
Created May 1, 2018 22:01
Show Gist options
  • Save martinsson/76b6e6fff34da0a617800833013f2cfc to your computer and use it in GitHub Desktop.
Save martinsson/76b6e6fff34da0a617800833013f2cfc to your computer and use it in GitHub Desktop.
Bug generator: use of indices
let foundAnimal
for (animal in animals) {
if (animal.type === 'cat') {
foundAnimal = animal
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment