If I have this pice of code which checks is something already exist inside array
var array = [ 1, 5, 12, 31, 7, 69 ];
var array = $.grep(array, function(n, i) {
return (n == 112);
});
alert(array.length);
my question is simple one: How can I pass variable to this grep function and to use it instead of hardcoded 112 value inside expression?