Faulty Output in the Console

** Working on logical ways of returning
value using the logical Or operator i crossed checked my code to see what
error i made, after correcting my code i tried to run the code i still get an error message even after comparing my code to the tutorial provided i find it hard to understand why
i am not getting the right result.
**

here is the code below

function abTest(a, b) {


if( a < 0 || b < 0){

  return "Undefined"

}

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

}

console.log(abTest(2,-2));
  **Your code so far**
function abTest(a, b) {
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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

Challenge: Return Early Pattern for Functions

Link to the challenge:

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

HI @Yungxix !

Welcome to the forum!

Reread the instructions again.
Remember that undefined is a keyword not a string.

Also the u is not supposed to be capitalized.

1 Like

oh… would check it out

undefined is a value. It is one of the primitive values (data types).