Web APIs
Headers.get()
Read a header by case-insensitive name. Missing headers return null; multiple ordinary values may be combined. Example console output: 3 true.
Formal Syntax & Structure
javascript syntaxjavascript
headers.get(name)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Header name. |
Return Value
string or null
Combined header value or null.
Working Example
Example Snippetjavascript
const h=new Headers({"X-Count":" 3 "}); console.log(h.get("x-count"),h.get("missing")===null);