In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example:
Original URL:
const urlParams = new URLSearchParams(window.location.search); urlParams.set('order', 'date'); window.location.search = urlParams;
.set first agrument is the key, the second one is the value.