Skip to content

Instantly share code, notes, and snippets.

@ifedyukin
Last active September 26, 2017 06:30
Embed
What would you like to do?
Get params from url - javascript - ES6
window.document.location.search
.slice(1)
.split('&')
.reduce((acc, param) => {
const [name, value] = param.split('=');
acc[name] = value;
return acc;
}, {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment