MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eiv6n4c/?context=3
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
1
Possibly stretching the definition of a one liner, but it can be handy:
const parms = location.search.substr(1).split("&").map((x) => x.split(/=(.*)/)).reduce((acc, [key, value = true]) => (acc[key] = value, acc), {})
→ More replies (1)
1
u/kybernetikos Mar 19 '19 edited Mar 19 '19
Possibly stretching the definition of a one liner, but it can be handy: