Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Arvin iuunhao
Added: Jun 18, 2018 8:43 AM
Views: 13
Tags: js
解析url参数
  1. const getUrlParameters = url =>
  2.   url.match(/([^?=&]+)(=([^&]*))/g).reduce(
  3.     (a, v) => (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1), a), {}
  4.   );