4 ms·
That code is ugly anyway, something I would have wrote in middle school... why not: function check(x) { return test1(x) && test2(x) && test3(x) &&
by alerighi 6y ago
That code is ugly anyway, something I would have wrote in middle school... why not:
function check(x) {
return test1(x) && test2(x) && test3(x) && test4(x);
}
Or, since I assume is JavaScript, just:
const check = x => test1(x) && test2(x) && test3(x) && test4(x);
- brundolf 6y agoNobody would actually write this, it's just a demonstration of the pattern at hand for the sake of discussion