Skip to content

Instantly share code, notes, and snippets.

View xv1t's full-sized avatar

Victor F. xv1t

  • Kuibyshev, Russia
View GitHub Profile
@xv1t
xv1t / get_params.js
Last active November 6, 2017 18:10
Parse location params after `?` and return in the object
location.href
.split('?')[1]
.split('&')
.reduce(
function(result, el){
result=result || {};
result[ el.split('=')[0] ] = el.split('=')[1];
return result
},
{});