Update URL-parameters.md

Updated a file that was changed in the meantime
This commit is contained in:
Angelos Chalaris
2017-12-13 14:48:38 +02:00
committed by GitHub
parent 3b9f7337ba
commit c876845318

View File

@ -1,7 +1,6 @@
### URL parameters
Use `match()` with an appropriate regular expression to get all key-value pairs, `Array.map()` them appropriately.
Combine all key-value pairs into a single object using `Object.assign()` and the spread operator (`...`).
Use `match()` with an appropriate regular expression to get all key-value pairs, `Array.reduce()` to map and combine them into a single object.
Pass `location.search` as the argument to apply to the current `url`.
```js