Return Early Pattern for Functions -- Question about it

Return Early Pattern for Functions -- Question about it
0

#1

I already finished the challenge and understood it fine… My question is:

WHAT IN THE HELL IS THE MATH PART AT THE BOTTOM FOR?? YOU KNOW, THE PART THAT SAYS–>

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

Your code so far

// 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);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0.

Link to the challenge:


#2

It is a calculation using the a and b variables which would return if your code does not work correctly. It is not important to understand this code to pass the challenge. When you click Run tests, behind the scenes the tests are looking for specific values to come through to know if you correctly coded your solution. If you really want to know what the calculation represents, the line above would return the result of the following formula rounded to the nearest integer.
image


#3

The rounded result of image