In Spinach Power, I get a type error for enemy.health, but the code works anyway
- In real-world programming, is it important to eliminate the error if the program still works, or could I just leave it at that?
- If it is important, how can I solve this level without getting that error? The way I see it, after hero defeats the second enemy, the next
hero.findNearestEnemyreturns null, and the health of null can’t be determined. But I need that “health-check”, yeah?