function inArray(value, array) {
if (!array)
array = this;
for (var i = 0; i < array.length; i++) {
if (value === array[i]) {
return true;
}
}
return false;
}
Array.prototype.inArray = inArray;
console.log([1, 10, 145, 8].inArray(10));
console.log(inArray(100, [1, 10, 145, 8]));