var timer = null;// typrof timer == 'object';
timer = setInterval(function() {
//...
}, 1000);// typeof timer == 'number'
clearInterval(timer);// typeof timer == 'number'
timer = null; // typrof timer == 'object';
即在清楚定时器的时候加上timer = null 在开启定时器的时候判断 if(typeof timer == 'object'){
//开启定时器
}