CKTIS / JavaScript
Response.status — response status code
Response.status exposes a response’s numeric status code. Distinguish the HTTP status, the ok property, and rejection of the fetch() promise.
Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
Syntax
response.statusResponse.status is a read-only instance property returning a number. Read it as response.status, without parentheses. It belongs to the Fetch standard, not ECMAScript.
response.ok indicates status 200–299; response.statusText contains the status message, not the code. An HTTP 404 or 500 response alone does not reject the fetch() promise — check the status explicitly.
Status 0 occurs for Response.error() and responses of type opaque and opaqueredirect; it is not a server HTTP code. A network error in fetch() rejects the promise instead of delivering such a response.
Examples
const responses = [
new Response(null, { status: 200 }),
new Response(null, { status: 404 }),
Response.error()
];
for (const response of responses) {
console.log(response.status, response.ok);
}Result
200 true 404 false 0 false
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.