Files
browser-wakatime/assets/js/helpers/in_array.js
2017-04-18 12:12:54 -06:00

18 lines
340 B
JavaScript

/**
* Returns boolean if needle is found in haystack or not.
*
* @param needle
* @param haystack
* @returns {boolean}
*/
function in_array(needle, haystack) {
for (var i = 0; i < haystack.length; i ++) {
if (needle == haystack[i]) {
return true;
}
}
return false;
}
module.exports = in_array;