Skip to content

Instantly share code, notes, and snippets.

@tracend
Last active May 26, 2020 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracend/570113fcb329aaf69bf0 to your computer and use it in GitHub Desktop.
Save tracend/570113fcb329aaf69bf0 to your computer and use it in GitHub Desktop.
_.inArray() #underscore #mixin #cc
_.mixin({
// - Checks if a string is in an Array
// Source: https://gist.github.com/tracend/570113fcb329aaf69bf0
inArray: function(value, array){
// if not an array just output false
return ( array instanceof Array ) ? (array.indexOf(value) > -1) : false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment