From 4a71bb886ff5b39e3fb809a7a86abc3cbda410fd Mon Sep 17 00:00:00 2001 From: Marcel Michau Date: Thu, 14 Dec 2017 17:53:32 +0200 Subject: [PATCH 1/3] Minor grammar fix in array-concatenation snippet & rebuilt README --- README.md | 4 ++-- snippets/array-concatenation.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 65a72b1a0..ba2c3d8bd 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ * [Promisify](#promisify) * [Random integer in range](#random-integer-in-range) * [Random number in range](#random-number-in-range) -* [Redirect to URL](#redirect-to-url) +* [Redirect to url](#redirect-to-url) * [Reverse a string](#reverse-a-string) * [RGB to hexadecimal](#rgb-to-hexadecimal) * [Run promises in series](#run-promises-in-series) @@ -110,7 +110,7 @@ const anagrams = str => { [⬆ back to top](#table-of-contents) ### Array concatenation -Use `Array.concat()` to concatenate and array with any additional arrays and/or values, specified in `args`. +Use `Array.concat()` to concatenate an array with any additional arrays and/or values, specified in `args`. ```js const arrayConcat = (arr, ...args) => arr.concat(...args); diff --git a/snippets/array-concatenation.md b/snippets/array-concatenation.md index b4e2fa205..992036905 100644 --- a/snippets/array-concatenation.md +++ b/snippets/array-concatenation.md @@ -1,6 +1,6 @@ ### Array concatenation -Use `Array.concat()` to concatenate and array with any additional arrays and/or values, specified in `args`. +Use `Array.concat()` to concatenate an array with any additional arrays and/or values, specified in `args`. ```js const arrayConcat = (arr, ...args) => arr.concat(...args); From a1341458ab31a8aa457d833e48f9ccfd8ca8c519 Mon Sep 17 00:00:00 2001 From: Marcel Michau Date: Thu, 14 Dec 2017 18:01:43 +0200 Subject: [PATCH 2/3] Renamed 'redirect-to-url.md' to 'redirect-to-URL.md' to keep case consistent with other headings --- README.md | 2 +- snippets/redirect-to-url.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba2c3d8bd..bb4b99a85 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ * [Promisify](#promisify) * [Random integer in range](#random-integer-in-range) * [Random number in range](#random-number-in-range) -* [Redirect to url](#redirect-to-url) +* [Redirect to URL](#redirect-to-url) * [Reverse a string](#reverse-a-string) * [RGB to hexadecimal](#rgb-to-hexadecimal) * [Run promises in series](#run-promises-in-series) diff --git a/snippets/redirect-to-url.md b/snippets/redirect-to-url.md index dab1f775b..70356686f 100644 --- a/snippets/redirect-to-url.md +++ b/snippets/redirect-to-url.md @@ -5,6 +5,6 @@ Pass a second argument to simulate a link click (`true` - default) or an HTTP re ```js const redirect = (url, asLink = true) => - asLink ? window.location.href = url : window.location.replace(url); + asLink ? (window.location.href = url) : window.location.replace(url); // redirect('https://google.com') ``` From e4e8ea98dc509aee3e0938eb952e7a476d229382 Mon Sep 17 00:00:00 2001 From: Marcel Michau Date: Thu, 14 Dec 2017 18:07:29 +0200 Subject: [PATCH 3/3] Undo Prettier auto-formatting --- snippets/{redirect-to-url.md => redirect-to-URL.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename snippets/{redirect-to-url.md => redirect-to-URL.md} (80%) diff --git a/snippets/redirect-to-url.md b/snippets/redirect-to-URL.md similarity index 80% rename from snippets/redirect-to-url.md rename to snippets/redirect-to-URL.md index 70356686f..dab1f775b 100644 --- a/snippets/redirect-to-url.md +++ b/snippets/redirect-to-URL.md @@ -5,6 +5,6 @@ Pass a second argument to simulate a link click (`true` - default) or an HTTP re ```js const redirect = (url, asLink = true) => - asLink ? (window.location.href = url) : window.location.replace(url); + asLink ? window.location.href = url : window.location.replace(url); // redirect('https://google.com') ```