I am looking for a shorter way to write:
$('div')
.filter(function(value) {
return runMyTestFunction(value);
})
.hide()
.end()
.filter(function(value) {
return !runMyTestFunction(value);
})
.show();
Hope something like:
$('div')
.filter(function(value) {
return runMyTestFunction(value);
})
.hide()
.end()
.remove(theLastWrappedSetPoppedOfftheJqueryStack)
.show();
I want to define the "runMyTestFunction" inline as lambda, since I think this will make the code more clear, but as it is written, I will have to duplicate it.
source
share