Web APIs
Headers.has()
Check for a header name without interpreting its value. Header names are case-insensitive. Example console output: true false.
Formal Syntax & Structure
javascript syntaxjavascript
headers.has(name)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Header name. |
Return Value
boolean
Whether the header exists.
Working Example
Example Snippetjavascript
const h=new Headers({"X-Mode":""}); console.log(h.has("x-mode"),h.has("x-other"));