HighlightRegistry: has() method
The has()
method of the HighlightRegistry
interface returns a boolean indicating whether or not a Highlight
object with the specified name exists in the registry.
HighlightRegistry
is a Map
-like object, so this is similar to using Map.has()
.
Syntax
Parameters
-
name
-
The name of the Highlight
object to test for presence in the registry.
Return value
Returns true
if a highlight with the specified name exists in the registry; otherwise false
.
Examples
const fooHighlight = new Highlight();
CSS.highlights.set("foo", fooHighlight);
myHighlight.has("foo");
myHighlight.has("bar");
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
has |
105 |
105 |
preview |
No |
91 |
No |
105 |
105 |
No |
72 |
No |
20.0 |
See also