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.
Probably the shortest solution for simple cases:
location.search .slice(1) .split('&') .map(p => p.split('=')) .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {});