How to use a Debounce function in JavaScript

How to use a Debounce function in JavaScript