Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-20 23:02:01 +03:00
parent 52880f08ee
commit caa67e2a49
63 changed files with 175 additions and 126 deletions

View File

@ -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);