From c876845318b9b59982a0ef62846e976f0c2b5aed Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 13 Dec 2017 14:48:38 +0200 Subject: [PATCH] Update URL-parameters.md Updated a file that was changed in the meantime --- snippets/URL-parameters.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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