Skip to content

Instantly share code, notes, and snippets.

@Ahrengot
Created January 7, 2012 18:17
Show Gist options
  • Save Ahrengot/1575543 to your computer and use it in GitHub Desktop.
Save Ahrengot/1575543 to your computer and use it in GitHub Desktop.
Checks if value exists in array
function inArray(arr, val) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == val) return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment