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