# Return Early Pattern for Functions problem in output

**URL:** <https://forum.freecodecamp.org/t/return-early-pattern-for-functions-problem-in-output/177764>\
**Category:** General\
**Created:** [March 3, 2018, 10:10pm UTC](https://forum.freecodecamp.org/t/return-early-pattern-for-functions-problem-in-output/177764 "2018-03-03T22:10:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roshanaara](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roshanaara/32/80462_2.png) [@Roshanaara](https://forum.freecodecamp.org/u/Roshanaara)\
**Post date:** [March 3, 2018, 10:10pm UTC](https://forum.freecodecamp.org/t/return-early-pattern-for-functions-problem-in-output/177764/1 "2018-03-03T22:10:39Z")

</div>

Hi Everyone,  
As per the assignment if a or b less than zero then it should return undefined as output but in my case, the code is getting passed, but the output is blank. Kindly help me to find out where is the problem?

**Your code so far**

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

// Change values below to test your code
abTest(2,-2);

```

**Your browser information:**

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

**Link to the challenge:**  
[https://www.freecodecamp.org/challenges/return-early-pattern-for-functions](https://www.freecodecamp.org/challenges/return-early-pattern-for-functions)

---

<div class="post-metadata">

**Author:** ![hadrienallemon](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hadrienallemon](https://forum.freecodecamp.org/u/hadrienallemon)\
**Post date:** [March 4, 2018, 12:51am UTC](https://forum.freecodecamp.org/t/return-early-pattern-for-functions-problem-in-output/177764/2 "2018-03-04T00:51:19Z")

</div>

It’s weird, I pasted in your code in my own challenge and it worked fine on me.

Try and paste it with another browser, like chrome or something, and if it still doesn’t work just keep this challenge, the awnser you got is right so you can consider it done anyway.

---

<div class="post-metadata">

**Author:** ![Roshanaara](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roshanaara/32/80462_2.png) [@Roshanaara](https://forum.freecodecamp.org/u/Roshanaara)\
**Post date:** [March 4, 2018, 6:04pm UTC](https://forum.freecodecamp.org/t/return-early-pattern-for-functions-problem-in-output/177764/4 "2018-03-04T18:04:01Z")

</div>

thank you everyone. Yeah, I tried on the actual console and its working fine.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:25pm UTC](https://forum.freecodecamp.org/t/return-early-pattern-for-functions-problem-in-output/177764/5 "2021-01-17T20:25:15Z")

</div>

Closed on January 17, 2021, 8:25pm UTC


