1.4 KiB
1.4 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
cf1111c1c12feddfaeb3bdef | Use Conditional Logic with If Statements | 1 |
Description
undefined
Instructions
undefined
Tests
tests:
- text: ''
testString: 'assert(typeof trueOrFalse === "function", "<code>trueOrFalse</code> should be a function");'
- text: ''
testString: 'assert(typeof trueOrFalse(true) === "string", "<code>trueOrFalse(true)</code> should return a string");'
- text: ''
testString: 'assert(typeof trueOrFalse(false) === "string", "<code>trueOrFalse(false)</code> should return a string");'
- text: ''
testString: 'assert(trueOrFalse(true) === "Yes, that was true", "<code>trueOrFalse(true)</code> should return "Yes, that was true"");'
- text: ''
testString: 'assert(trueOrFalse(false) === "No, that was false", "<code>trueOrFalse(false)</code> should return "No, that was false"");'
Challenge Seed
// Example
function ourTrueOrFalse(isItTrue) {
if (isItTrue) {
return "Yes, it's true";
}
return "No, it's false";
}
// Setup
function trueOrFalse(wasThatTrue) {
// Only change code below this line.
// Only change code above this line.
}
// Change this value to test
trueOrFalse(true);
Solution
// solution required