Last active
May 26, 2020 13:25
-
-
Save tracend/570113fcb329aaf69bf0 to your computer and use it in GitHub Desktop.
_.inArray() #underscore #mixin #cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.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