Lesson 3: Why doesn't slaying = 0 work?


#1



https://www.codecademy.com/courses/javascript-beginner-en-mrTNH-6VIZ9/0/3


These are the instructions: "Create a while loop that only executes when slaying is true. For this exercise, set slaying to false in the body of the loop. "

If I set slaying to false using
slaying = false

The code will be correct and I can move on.

But if I use
slaying = 0

I'm told that I did not set slaying to false. Shouldn't both styles be correct? Shouldn't my answer be more correct, given that a previous lesson instructed us to type as little as necessary?


#2

slaying = 0

zero is considered false, so this would normally work, but the checking script doesn't like it. The problem is, that there are many ways to solve the problem, if we need to cover them all, the checking script becomes rather huge