Error in code example logic in first lesson (1. What code is Like)
Opened this issue · 0 comments
nocturnalmc commented
Issue description:
A clear and concise description of what the issue is.
- In the section to try to spot similarities & differences in different languages there are error in the code logic
function take_damage(amout) {
health -= amount
if (health < 0) {
die()
}
}
- Where as if health is exactly === 0 the function die() will not be called. Which mean the character still alive when health is exactly === 0
- I think the correct comparison operator here is <=