Skip to content

Instantly share code, notes, and snippets.

ladas-larry

  • Berlin, Germany
Block or report user

Report or block ladas-larry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ladas-larry
ladas-larry / parseQuery.js
Last active Aug 13, 2017
Parse query string
View parseQuery.js
function parseQuery(locationSearch) {
locationSearch = locationSearch.substring(1); // remove "?" at the beginning
var values = locationSearch.split('&');
var queryObj = values.reduce(function (result, item) {
var parts = item.split('=');
result[decodeURIComponent(parts[0])] = parts[1];
return result;
}, {});
return queryObj;
}
You can’t perform that action at this time.