Skip to content

Instantly share code, notes, and snippets.

@agrublev
Created June 7, 2019 15:02
Show Gist options
  • Save agrublev/25a7775486240a2e3a86016b3c84861b to your computer and use it in GitHub Desktop.
Save agrublev/25a7775486240a2e3a86016b3c84861b to your computer and use it in GitHub Desktop.
const arr1 = [1, 2, 3, 4, 5];
if (arr1.indexOf(1) !== -1) {
console.log("Arr1 HAS the integer 1!");
}
if (arr1.includes(1)) {
console.log("Arr1 HAS the integer 1!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment