Clear previous timeouts before creating new ones:
js
// inside a function
if (this.existingTimeout) clearTimeout(this.existingTimeout);
this.existingTimeout = setTimeout(function() {
console.log('Hello');
});
28 October 2014
Clear previous timeouts before creating new ones:
// inside a function
if (this.existingTimeout) clearTimeout(this.existingTimeout);
this.existingTimeout = setTimeout(function() {
console.log('Hello');
});