curriculum/challenges/english/blocks/daily-coding-challenges-javascript/69738771fb5a7b8b24cca2a2.md
Today is Groundhog Day, in which a groundhog predicts the weather based on whether or not it sees its shadow.
Given a value representing the groundhog's appearance, return the correct prediction:
true (the groundhog saw its shadow), return "Looks like we'll have six more weeks of winter.".false (the groundhog did not see its shadow), return "It's going to be an early spring."."No prediction this year.".groundhogDayPrediction(true) should return "Looks like we'll have six more weeks of winter.".
assert.equal(groundhogDayPrediction(true), "Looks like we'll have six more weeks of winter.");
groundhogDayPrediction(false) should return "It's going to be an early spring.".
assert.equal(groundhogDayPrediction(false), "It's going to be an early spring.");
groundhogDayPrediction(null) should return "No prediction this year.".
assert.equal(groundhogDayPrediction(null), "No prediction this year.");
groundhogDayPrediction(" ") should return "No prediction this year.".
assert.equal(groundhogDayPrediction(" "), "No prediction this year.");
groundhogDayPrediction("true") should return "No prediction this year.".
assert.equal(groundhogDayPrediction("true"), "No prediction this year.");
function groundhogDayPrediction(appearance) {
return appearance;
}
function groundhogDayPrediction(appearance) {
if (appearance === true) return "Looks like we'll have six more weeks of winter.";
if (appearance === false) return "It's going to be an early spring.";
return "No prediction this year.";
}