Renamed 'redirect-to-url.md' to 'redirect-to-URL.md' to keep case consistent with other headings
This commit is contained in:
@ -69,7 +69,7 @@
|
|||||||
* [Promisify](#promisify)
|
* [Promisify](#promisify)
|
||||||
* [Random integer in range](#random-integer-in-range)
|
* [Random integer in range](#random-integer-in-range)
|
||||||
* [Random number in range](#random-number-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)
|
* [Reverse a string](#reverse-a-string)
|
||||||
* [RGB to hexadecimal](#rgb-to-hexadecimal)
|
* [RGB to hexadecimal](#rgb-to-hexadecimal)
|
||||||
* [Run promises in series](#run-promises-in-series)
|
* [Run promises in series](#run-promises-in-series)
|
||||||
|
|||||||
@ -5,6 +5,6 @@ Pass a second argument to simulate a link click (`true` - default) or an HTTP re
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const redirect = (url, asLink = true) =>
|
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')
|
// redirect('https://google.com')
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user