function checkStatus(response) {
    if (!response.ok) {
        const error = new Error(response.statusText);
        error.response = response;
        throw error;
    }
    return response;
}
// So we inspect the response.status (response.ok is true for HTTP 2xx) and throw otherwise.
So we inspect the response.status (response.ok is true for HTTP 2xx) and throw otherwise.
So we inspect the response . status ( response . ok is true for HTTP 2xx ) and throw otherwise .
function checkStatus(response) {
    if (!response.ok) {
        const error = new Error(response.statusText);
        error.response = response;
        throw error;
    }
    return response;
}
function checkStatus ( response ) { if ( ! response . ok ) { const error = new Error ( response . statusText ) ; error . response = response ; throw error ; } return response ; }
So we inspect the response.status (response.ok is true for HTTP 2xx) and throw otherwise.
So we inspect the response . status ( response . ok is true for HTTP 2xx ) and throw otherwise .