How to constantly execute an if statement : <p>I guess it is not possible, but I just wanted to know if it could be possible to have an if statement always "active". I am creating a text-based game and the health variable of the character is changing often, so when it reaches 0 or below, i want to execute a "dead" function. </p>

<pre><code>if (health &lt; 1) {
  //code
};
</code></pre>

<p>Do I have to include that if-statement everytime in the object, when the health variable changes? </p>

<p>Thank you a lot :)</p>
