Returning Boolean Values from Functions
See original GitHub issueChallenge 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No! You can see on the screenshot I used isLess function like in Instructions, but I make mistake in another place. Thank’s!
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!