BrandingLab
WBWeb Bae
•Created by BrandingLab on 5/5/2024 in #❓︱questions
Im a newbie, I can get past this step. Please help.
Hi there. Can someone pls help. I have checked this code over and over again and can not see any errors.
Task 6: Control Structures - Conditional Statements*/
// Define a variable named studentGrade that is of type number.
let studentGrade = 70;
function gradeCommentary() {
// 1. If studentGrade is above or equal to 90, log "Excellent work!".
if (studentGrade >= 90) {
console.log("Excellent work!");
}
// 2. If studentGrade is between 80 and 89 (inclusive), log "Good job!"
else if (studentGrade >= 80 && studentGrade <= 89) {
console.log("Good job!");
}
// 3. If studentGrade is between 70 and 79 (inclusive), log "You passed.".
else if (studentGrade >= 70 && studentGrade <= 79) {
console.log("You passed.");
}
// 4. If studentGrade is below 70, log "Needs improvement.".
else {
console.log("Needs improvement.");
}
}
7 replies