# Basic JavaScript - Returning Boolean Values from Functions

**URL:** <https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [October 19, 2023, 7:07pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502 "2023-10-19T19:07:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsulun](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fsulun/32/332242_2.png) [@fsulun](https://forum.freecodecamp.org/u/fsulun)\
**Post date:** [October 19, 2023, 7:07pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/1 "2023-10-19T19:07:48Z")

</div>

**Tell us what’s haActually there is a very simple answer and everything is as it should be for the answer. But I can’t get past this question. I don’t know if it’s my answer or the system.ppening:**  
Describe your issue in detail here.

**Your code so far**

```javascript
function isLess(a, b) {
  // Only change code below this line
  function isLess(a, b) {
    return a < b;
  
  }

  
  // Only change code above this line
}
isLess(10, 15);

```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36`

**Challenge:** Basic JavaScript - Returning Boolean Values from Functions

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [October 19, 2023, 7:09pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/2 "2023-10-19T19:09:55Z")

</div>

> [@fsulun](#):
>
> ```auto
> function isLess(a, b) {
> return a < b;
>   
> }
> 
> ```

Why did you declare the function inside of the function?

---

<div class="post-metadata">

**Author:** ![fsulun](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fsulun/32/332242_2.png) [@fsulun](https://forum.freecodecamp.org/u/fsulun)\
**Post date:** [October 19, 2023, 7:28pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/3 "2023-10-19T19:28:11Z")

</div>

Because without it there is no response. I have tried many times without “function”, the console test result is positive but it does not progress.

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [October 19, 2023, 7:33pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/4 "2023-10-19T19:33:03Z")

</div>

I’m not sure what you mean by ‘no response’ exactly?

There is no return value when you do put the function definition inside of a function definition.

Using the `function` keyword and the exact same function name inside of a function definition is a huge red flag.

> [@fsulun](#):
>
> ```auto
> function isLess(a, b) {
> // Only change code below this line
> function isLess(a, b) {
> 
> ```

---

<div class="post-metadata">

**Author:** ![fsulun](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fsulun/32/332242_2.png) [@fsulun](https://forum.freecodecamp.org/u/fsulun)\
**Post date:** [October 19, 2023, 7:43pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/5 "2023-10-19T19:43:13Z")

</div>

Console and code screenshot attached. There is no progress.

 ![Screenshot_2023-10-19-22-37-55-416_com.android.chrome](https://global.discourse-cdn.com/freecodecamp/original/4X/0/e/1/0e1ab26641170cb730ca0d6c0c38badfe9d81a1f.jpeg)  
 ![Screenshot_2023-10-19-22-36-33-941_com.android.chrome](https://global.discourse-cdn.com/freecodecamp/original/4X/1/5/b/15be3ef5d76c31202734cc5d85b38e6734846629.jpeg)

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [October 19, 2023, 7:48pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/6 "2023-10-19T19:48:11Z")

</div>

You still have the same problem - you are now declaring `isLess` inside of `isLess` without using the `function` keyword.

Why did you type `isLess`? Its already there once. It doesn’t need to be there twice.

---

<div class="post-metadata">

**Author:** ![fsulun](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fsulun/32/332242_2.png) [@fsulun](https://forum.freecodecamp.org/u/fsulun)\
**Post date:** [October 19, 2023, 7:57pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/7 "2023-10-19T19:57:59Z")

</div>

There are no other clues. I’ve done a lot of research. I’ve worked for hours without a clue.

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [October 19, 2023, 8:00pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/8 "2023-10-19T20:00:11Z")

</div>

Here is a clue:

> [@JeremyLT](#):
>
> Why did you type `isLess`? Its already there once. It doesn’t need to be there twice.

Did you try not typing `isLess` twice?

There isn’t anything asking you to type what you have on line 3. Delete it.

---

<div class="post-metadata">

**Author:** ![fsulun](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fsulun/32/332242_2.png) [@fsulun](https://forum.freecodecamp.org/u/fsulun)\
**Post date:** [October 19, 2023, 8:11pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/9 "2023-10-19T20:11:57Z")

</div>

:))  
I just tried it. Life is full of surprises.  
After your guidance I thought like this;  
If there is no “function” and “ifElse”, there is no (a, b).  
Thank you very much for your support.  
Thank you very much.

 ![Screenshot_2023-10-19-23-04-13-815_com.android.chrome-edit](https://global.discourse-cdn.com/freecodecamp/original/4X/e/0/9/e09a1c067e1b02f775a0ce2ba8beb916c14dbb54.jpeg)  
 ![Screenshot_2023-10-19-23-03-36-274_com.android.chrome-edit](https://global.discourse-cdn.com/freecodecamp/original/4X/f/4/5/f452542707228d57a4b10da2bacd5691a353f23b.jpeg)

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [October 19, 2023, 8:13pm UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/10 "2023-10-19T20:13:30Z")

</div>

Congrats!

Note - you should share your actual code, not a screenshot!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [April 19, 2024, 8:14am UTC](https://forum.freecodecamp.org/t/basic-javascript-returning-boolean-values-from-functions/645502/11 "2024-04-19T08:14:00Z")

</div>

Closed on April 19, 2024, 8:14am UTC

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