Syntax error returned2

This is what i get when i run test : SyntaxError: unknown: ‘return’ outside of function (10:2)

  **Your code so far**

function testLogicalAnd(val) {
// Only change code below this line

if (val <= 50 && val >= 25) { return "Yes"; }

  
}

// Only change code above this line
return "No";
}

testLogicalAnd(10);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36.

Challenge: Comparisons with the Logical And Operator

Link to the challenge:

match the opening and closing brackets {} and make sure they are equal/balanced.

2 Likes

I will try that out and get back to you. thank you

I have tried and it didn’t work

could you please post what was tried ?
you need to remove the } before the comment

if (val <= 50 && val >= 25) { return "Yes"; }
} ###remove this

// Only change code above this line
return "No";
1 Like

Thank you. it finally passed

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.