Skip to content

Instantly share code, notes, and snippets.

View edwilliams's full-sized avatar

Ed Williams edwilliams

View GitHub Profile
@edwilliams
edwilliams / getQueryParams.js
Last active April 20, 2016 15:04 — forked from ryoppy/getQueryParams.js
Parse query string. use Underscore.js.
/**
* Parse query string.
* ?a=b&c=d to {a: b, c: d}
* @param {String} (option) queryString
* @return {Object} query params
*/
_.getQueryParams = function(queryString) {
if (!queryString) { return false; }
return _.chain(queryString.split('&'))
.map(function(params) {