Suppose I have a function which returns nothing, with code that should execute only if a condition is not met. What is best from a performance/efficiency perspective:
- to begin with a conditional return statement:
function f() {
if (condition) return;
// Do something...
}
- or to use a conditional block:
function f() {
if (!condition) {
// Do something...
}
}
?