title: How to check express local variable exists when in script tag of jade?
body: <p>I have a data variable sent to client-side, but it may not always be included as a variable in the express locals. If it doesn't exist, <code>var data = !{JSON.stringify(data)};</code> returns <code>var data = ;</code> which causes a js error. </p>
  
  <p>I've tried using conditionals prefixed with '-' but that doesn't seem to work.</p>
  
  <pre><code>script(type='text/javascript')
      - if locals.data
          var data = !{JSON.stringify(data)};
      - else
          var data = {};
  </code></pre>
  
  <p>How do I give it a default if locals.data is undefined?</p>