Return Early Pattern for Functions 3 hours sleep catching up to me

Tell us what’s happening:

i know it must be a simple answer but i cant figure it out, i’ve tried lots of different things but i’m not exactly sure what they are wanting

Your code so far


// Setup
function abTest(a, b) {
  // Only change code below this line
  console.log()
  
  
  
  // 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:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/return-early-pattern-for-functions

so is it an if function? i tried if and no dice, i tried stuff with a || b < 0 but i cant figure out any of the right syntax

shit :see_no_evil: that’s right ok, so what am i asking the computer to do once it determines if they are < 0 is this a switch thing or if function or… oh man i feel so dumb i need more sleep lol

this is all i got am i even close?
if (a > 0 || b > 0) {
return
}

that feeling when you eat dinner come back to coding and see your stupidest mistakes, here i was thinking i had the syntax all bleeped up.

thank you so much for your patience with me, i was able to clear the challenge.

You are a gentleman and a scholar

1 Like