Why do we use logical operators along with comparison operators? I'm still quite new to coding, whenever my lecturers gave us some example they always write like this:
if (totalMark >= 0 && totalMark < 40) {
finalGrade = "F";
document.getElementById("final_grade").value = finalGrade;
}
Why not just use comparison operator?
if (0 <= totalMark < 40) {
finalGrade = "F";
document.getElementById("final_grade").value = finalGrade;
}
Is there any advantages of using one over the other or is it just the same?