I forgot to mention using the result of bar to calculate foo's value in the question I asked here.
The function bar only needs to be called if conditionA is true. But when the result of bar (resultBar) is falsy, I want to run the code that would have run if conditionA had been false. Is there a more concise way of approaching this without duplication?
var scale = 1;
if(settings.doUseOutlines) {
var typefaceSize = getTypefaceSize(typefaceComp);
if(typefaceSize) {
scale = parseFloat(settings.fontScale) / typefaceSize[1];
} else {
scale = parseFloat(settings.fontScale) / typefaceComp.height; // duplicated
}
} else {
scale = parseFloat(settings.fontScale) / typefaceComp.height;
}