Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Return Early Pattern for Functions

// Setup
function abTest(a, b) {
  // Only change code below this line
  if (a < 0 || b < 0) {
    return undefined;
  }

  // Only change code above this line

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

// Change values below to test your code
abTest(2, 2);
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Return #Early #Pattern #Functions
ADD COMMENT
Topic
Name
9+4 =