question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Returning Boolean Values from Functions

See original GitHub issue

Challenge Name

Returning Boolean Values from Functions

Issue Description

function isLess(a, b) { return a === b; } isLess(10, 15);

This function return “false” and it is OK, but unfortunately checkpoints say “isLess(10,15) should return true” and it is not OK, because 10 not equal 15

Browser Information

  • Google Chrome, Version: 52.0.2743.82 m
  • Operating System: Windows 8.1
  • Desktop

Your Code


function isLess(a, b) {
    return a === b;
  } 

isLess(10, 15);

Screenshot

2016-08-30_104905

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
OstapKoverkocommented, Aug 30, 2016

You have used the code from the example function, isEqual, instead of the code from the function in the editor, isLess

No! You can see on the screenshot I used isLess function like in Instructions, but I make mistake in another place. Thank’s!

1reaction
BKinahancommented, Aug 30, 2016

Hi @OstapKoverko

You have used the code from the example function, isEqual, instead of the code from the function in the editor, isLess. Reset your code, read the instructions again, and if you still have questions remember to visit the HelpJavaScript chat room before raising an issue about code that fails a test.

Happy coding!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Returning Boolean Values from Functions - Guide
In order to return true or false you don't need two statements nor use if ones. The correct comparison operator is all you...
Read more >
5.8. Bool Functions — How to Think Like a Computer Scientist
The name of this function is isSingleDigit. It is common to give boolean functions names that sound like yes/no questions. The return type...
Read more >
How to return boolean value from a function? - Treehouse
Initialization of immutable value 'isPositive' was never used · Cannot convert return expression of type '(Int) -> Bool' to return type 'Bool' ...
Read more >
JavaScript function return boolean | Example code
You can return a boolean value from a JavaScript function. Create a function and use the if statement to evaluate the given value...
Read more >
Python Return Boolean (True/False) From Function - Finxter
A Python function can return any object such as a Boolean value ( True or False ). To return a Boolean, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found