So what is else{} should be code

Tell us what’s happening:

Your code so far

// Setup
function abTest(a, b) {
  // Only change code below this line
    return undefined;
    return number ;
  // 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

Your browser information:

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

Link to the challenge:

Hi David4,

Conditional statement with two conditions should be like this:

if ( z < 1000 || x < 1000)

hope this helps! happy coding!

I think you meant to say:

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

The way you were writing it a||b<0 actually always returns true because the variable a is the only thing on the left-hand-side of the or operator and as such it is evaluated first. Since it is not a boolean, it will alway be true unless it is 0 (zero is the only number that is not evaluating to true). (additional reading for you:

This is kind of hard for me to explain to a newbie, but I hope I’ve given you enough info.

OK.I will try it. thx for your help.:grinning::grinning:

1 Like