debounce(func, wait) {
		let timeout;
		return function debounced(...args) {
			const later = () => {
				clearTimeout(timeout);
				func.apply(this, args);
			};
			clearTimeout(timeout);
			timeout = setTimeout(later, wait);
		};
	}
Creates a debounced function that delays invoking the input function until after 'wait' milliseconds have elapsed
since the last time the debounced function was invoked. Useful for implementing behavior that should only happen
after the input is complete.

@param {Function} func - The function to debounce.
@param {number} wait - The number of milliseconds to delay.
@returns {Function} The new debounced function.
@example
window.addEventListener('resize', debounce(myFunction, 200));