Added samples
This commit is contained in:
@ -7,4 +7,5 @@ Pass `location.search` as the argument to apply to the current `url`.
|
||||
```js
|
||||
const getUrlParameters = url =>
|
||||
Object.assign(...url.match(/([^?=&]+)(=([^&]*))?/g).map(m => {[f,v] = m.split('='); return {[f]:v}}));
|
||||
// getUrlParameters('http://url.com/page?name=Adam&surname=Smith') -> {name: 'Adam', surname: 'Smith'}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user