---
title: "Comment by Vansh Sharma on \"Understand Debouncing and Throttling in javascript with examples\" | Hashnode"
description: "Awesome man 👏👏 I saw this question in so many interview questions. If we want to distinguish between throttling and denouncing in one line How we will define?"
url: "https://hashnode.com/posts/understand-debouncing-and-throttling-in-javascript-with-examples/627ab32d199297a9505d4b57/comment/627ac9ae199297a9505d4dc9"
---

[Discussion](https://hashnode.com/posts/understand-debouncing-and-throttling-in-javascript-with-examples/627ab32d199297a9505d4b57)

Comment [Understand Debouncing and Throttling in javascript with examples](https://hashnode.com/posts/understand-debouncing-and-throttling-in-javascript-with-examples/627ab32d199297a9505d4b57)

[Vansh Sharma](https://hashnode.com/@vanshsharma)

[May 10, 2022](https://hashnode.com/posts/understand-debouncing-and-throttling-in-javascript-with-examples/627ab32d199297a9505d4b57/comment/627ac9ae199297a9505d4dc9)

Awesome man 👏👏 I saw this question in so many interview questions.

If we want to distinguish between throttling and denouncing in one line How we will define?

[Vishal Kumar](https://hashnode.com/@thisisvishal)

[May 11, 2022](https://hashnode.com/posts/understand-debouncing-and-throttling-in-javascript-with-examples/627ab32d199297a9505d4b57/comment/627ac9ae199297a9505d4dc9#reply-627bb428983a4ab69ce9d2b7)

Thankyou !!

As per your query let me define again in more simpler terms. Then,

`In throttling` , the function runs only once within given time period (let's say 1 second), no matter how many times user fires event in 1 second, the function will run only once. And function will run second time only after 1 second has been passed.

`In debouncing` , function runs only after a delay of when the user has stopped firing the event (let's say 1 second again). If the user has fired the event again within the 1 second. Then 1 second will be considered from that point. And function will be executed with the new 1 second and previous timing will be cancelled. Suppose user fires event again, then again new time will be generated. And function will execute only after user has stopped firing event. no matter how many times the user fires the event, the attached function will be executed only after the specified time once the user stops firing the event.

**Hope it helps**

[Vansh Sharma](https://hashnode.com/@vanshsharma)

[May 11, 2022](https://hashnode.com/posts/understand-debouncing-and-throttling-in-javascript-with-examples/627ab32d199297a9505d4b57/comment/627ac9ae199297a9505d4dc9#reply-627c1237e525f1b677138060)

Great 👏👏👏🔥🔥🔥[Vishal Kumar](https://hashnode.com/@thisisvishal)
