Need assistance on return pattern

Tell us what’s happening:

  **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));
} 


console.log(abTest(2,2));

  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 13421.89.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36.

Challenge: Return Early Pattern for Functions

Link to the challenge:

what kind of help do you need?

do the tests say something? do you have an error in the console?

As of right now, the instructions checklist is indicting that everything is wrong. However, I am not sure exactly what I need to do

is there anything written in the console?

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

console.log(abTest(2,2));

SyntaxError: unknown: Missing semicolon (4:19)

2 | function abTest(a, b) {
3 | // Only change code below this line

4 | If (a < 0 || b < 0) {
| ^
5 | return undefined;
6 | }
7 | // Only change code above this line

There is not a key word spelled If.

2 Likes