suppose we have a debounce function to make Http request in javascript.if the second request resolves faster than the first request, how to make sure that we are showing the relevant data to the user according to his/her last input?
consider the first Request's response comes in 10000 ms and the second Request's response comes sooner (like 4000 ms) because of the async nature of the network request.