Suppose I have the following code.
function divide(numerator, denominator) {
return new Promise((resolve, reject) => {
if(denominator === 0){
reject("Cannot divide by 0");
return; //superfluous?
}
resolve(numerator / denominator);
});
}
If my aim is to use reject
to exit early, should I get into the habit of return
ing immediately afterward as well?