javascript - Script error in line 0 on a JS environment -


i've got problem js code. have construct alarm clock objects, doesn't work, seems me fine. here is:

function alarmclock(){    this.hour;   this.minutes;   this.hours=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];    this.currenttime=     function(h, m){     this.hour=h;     this.minutes=m;     if (this.hour>23){       this.hour=0;     }     if(this.minutes>59){       this.minutes=0;     }   }    this.alarm=     function(h, m){     this.hour=h;     this.minutes=m;     if(this.hour>23){       this.hour=0;     }     if(this.minutes>59){       this.minutes=0;     }   }    this.tic=     function(){     var i=0;     while(i<=m){       m.currenttime+=i;     if(m.currenttime==60){       h.currenttime+=1;     }    if (h.currenttime==24){       h.currenttime=0;     }     if(((h.currenttime)&&(m.currenttime))==((h.alarm)&&(m.alarm))){       return ("time wake up!");     }else{         i++;     }   } }  function foo(){   var c=new alarmclock();   c.currenttime(13, 0);   c.alarm(13, 2); }   foo(); 

i've tried twice in 2 different environment:

how can ride on this?

thank :d

the function alarmclock() missing 1 last closing braces }. put } above function foo().


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -