Syntax error can't figure out

Tell us what’s happening:
Describe your issue in detail here.

Hi there! I tried figuring out what is wrong with the issue and although there may be some issues present in what I did, I even copied and pasted some solutions only to find that the syntax “isLess(10,15);” is showing as an error. I’m not too sure why that is. Can someone help me figure this out?
Thanks so much!

  **Your code so far**

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 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15

Challenge: Returning Boolean Values from Functions

Link to the challenge:

I’m a little bit confused here. Why did you declare the function twice?

You probably want to delete this line.

Here you are checking if a is equal to b, not if one is less than the other.

To expand on the previous comment, you don’t need to declare a function within the function. You only need one line of code returning a comparison of a and b (which resolves to true or false).

This is not the appropriate place to check less than and is not valid JavaScript.

1 | function isLess(a, b) {
  2 |   // Only change code below this line
> 3 |    function isLess (a < b) {
    |                       ^
  4 |    return a === b;

The “^” is pointing to your syntax error.

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