1.8 KiB
1.8 KiB
id, title, challengeType
id | title | challengeType |
---|---|---|
bd7123c9c441eddfaeb5bdef | Understanding Boolean Values | 1 |
Description
Booleans
may only be one of two values: true
or false
. They are basically little on-off switches, where true
is "on" and false
is "off." These two states are mutually exclusive.
NoteBoolean
values are never written with quotes. The strings
"true"
and "false"
are not Boolean
and have no special meaning in JavaScript.
Instructions
welcomeToBooleans
function so that it returns true
instead of false
when the run button is clicked.
Tests
tests:
- text: The <code>welcomeToBooleans()</code> function should return a boolean (true/false) value.
testString: assert(typeof welcomeToBooleans() === 'boolean', 'The <code>welcomeToBooleans()</code> function should return a boolean (true/false) value.');
- text: <code>welcomeToBooleans()</code> should return true.
testString: assert(welcomeToBooleans() === true, '<code>welcomeToBooleans()</code> should return true.');
Challenge Seed
function welcomeToBooleans() {
// Only change code below this line.
return false; // Change this line
// Only change code above this line.
}
After Test
welcomeToBooleans();
Solution
function welcomeToBooleans() {
return true; // Change this line
}