If I'd like to assign a type to a variable that will later be assigned a setInterval like so:
this.autoSaveInterval = setInterval(function(){
if(this.car.id){
this.save();
}
else{
this.create();
}
}.bind(this), 50000);
What type should be assigned to this.autosaveInterval vairable?
autoSaveInterval
will infer its type from the return value of thesetInterval
call. In browser platforms this isnumber
, but in node.js it's a Timer – Deface