title: Convert true and false in Coffeescript to 1 and -1 respectively
body: <pre><code>if x &lt; change.pageX # pageX is cross-browser normalized by jQuery
              val = Number(elem.text())
              return elem.text(o.max) if val + o.step &gt; o.max
              return elem.text(o.min) if val + o.step &lt; o.min
              elem.text(val + o.step)
  else x &gt; change.pageX
    # same thing, only - instead of +
  </code></pre>
  
  <p>(Coffee Script, but you get the idea). I'm looking for a trick to take a boolean and convert it to either 1 (true) or -1 (false). that way I can do <code>val + converted_bool * o.step</code> and save an if.</p>