Like Rayon said in the comments, in your setTimeout function callback you have another this than in your startTimer function, so myTimer isn't a member of it. undefined becomes NaN after the -- operation.

To fix it you can either use the var that = this; thing or use an arrow function: