Answers for "return early pattern for functions javascript"

1

return early pattern for functions javascript

function abTest(a, b) {

  if (a < 0 || b < 0){
    return undefined;
  }

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

abTest(2,2);
Posted by: Guest on July-18-2020

Code answers related to "return early pattern for functions javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language