Looking at your question looks like you are still learning jquery.However I am sure you will get good suggestions here.
Here is an example with your test case,I am leaving the explanation on you so that you can study each line and learn.
var myArray = [2, 4, 5, 8, 11];
var myValue = 9;
function BiggerThan(inArray) {
return inArray > myValue;
}
function LesserThan(inArray) {
return inArray < myValue;
}
var arrBiggerElements = myArray.filter(BiggerThan);
var nextElement = Math.min.apply(null, arrBiggerElements);
alert(nextElement);
var arrLesserElements = myArray.filter(LesserThan);
var prevElement = Math.max.apply(null, arrLesserElements);
alert(prevElement);