title: Javascript - Unexpected token if
body: <p>I'm getting an 'Unexpected token if' in the code below. I can't figure out why, the code looks legitimate to me.</p>
  
  <pre><code>var count = 30;
  var counter = count;
  var testinterval;
  
  testinterval = setInterval(function() {
    $('.counter').text(counter.'s');
    if (counter == 0) {
      testFunction();
      counter = count;
    } else {
      counter--;
    }
  }, 1000);
  </code></pre>
  
  <p>I've searched hi and low for an answer, maybe I'm just being blind.</p>