Given these two functions in JavaScript:
function (){
return _.includes(someLongArray, value) && someSimpleValue;
}
VS
function (){
return someSimpleValue && _.includes(someLongArray, value);
}
Which of those is going to have better performance?
When the someSimpleValue
is false, is it going to call the return automatically? Or is it going to verify if the second one is true or false (Useless cause when a &&
has some of them false it can't be truthy anymore)