3 JavaScript questions to watch out for during coding interviews
Daniel Borowski

Worth mentioning that, while I debounce using the same type of simple function most of the time, this is not a perfectly valid solution, since at first use it will still wait for two seconds before doing something; assuming the event fires regularly at an interval less than two seconds, your function will never be called. Here is a good example of a complete function: https://davidwalsh.name/javascript-debounce-function , allowing for calling the initial function at the leading edge.

Like what you read? Give Costin Manda a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.