Update snippet descriptions
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: isAbsoluteURL
|
||||
tags: string,browser,intermediate
|
||||
tags: string,browser,regexp,intermediate
|
||||
---
|
||||
|
||||
Returns `true` if the given string is an absolute URL, `false` otherwise.
|
||||
Checks if the given string is an absolute URL.
|
||||
|
||||
- Use a regular expression to test if the string is an absolute URL.
|
||||
- Use `RegExp.prototype.test()` to test if the string is an absolute URL.
|
||||
|
||||
```js
|
||||
const isAbsoluteURL = str => /^[a-z][a-z0-9+.-]*:/.test(str);
|
||||
|
||||
Reference in New Issue
Block a user