Is there a better way to convert a URL\'s location.search as an object? Maybe just more efficient or trimmed down? I\'m using jQuery, but pure JS can work too.
Please also note that there's an api to query/manipulate search params with: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
var params = new URLSearchParams(window.location.search) for (let p of params) { console.log(p); }