diff --git a/snippets/URL-parameters.md b/snippets/URL-parameters.md index 17daf16f0..42a43cc22 100644 --- a/snippets/URL-parameters.md +++ b/snippets/URL-parameters.md @@ -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