title: Can I detect if a variable in javascript increases or decreases in value?
body: <p>I have a a variable, which always is an integer, that increases and/or decreases in value from time to time, goes from 1-5.
  I wanted to know if I can, in any way, detect if it goes up or down, for example:</p>
  
  <p>The variable is currently at three, if it increases to four, it runs a function, but if it decreases to two, it runs another function.</p>
  
  <p>Can that be done?</p>