fork download
  1. this.decrement = function() {
  2. if(this.running == 1){
  3. setTimeout(function(){
  4. this.time--; //decrementing time ever 0.1 seconds
  5. if (this.time <= 0) { //if below 0, shutting down
  6. this.stop();
  7. var mins = Math.floor(this.time / 10 / 60);
  8. if(mins <= 9){
  9. mins = "0" + mins;
  10. }
  11. var secs = Math.ceil(this.time / 10);
  12. if(secs <= 9){
  13. secs = "0" + secs;
  14. }
  15. output.innerHTML = mins + ":" + secs; //presenting data to user
  16. this.decrement(); //NOT A FUNCTION?
  17. }, 100);
  18. }
  19. };
Runtime error #stdin #stdout #stderr 0.04s 16660KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:17:9 SyntaxError: expected expression, got ',':
prog.js:17:9         }, 100);
prog.js:17:9 .........^