logo

Crowdly

Browser

Add to Chrome

Що виведе наступний код, якщо сервер повернув статус 404? fetch('/api/data') ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Що виведе наступний код, якщо сервер повернув статус 404?

fetch('/api/data')

.then(res => {

if (!res.ok) throw new Error('Error ' + res.status);

return res.json();

})

.then(data => console.log(data))

.catch(err => console.log('caught'));

100%
0%
0%
0%
More questions like this

Want instant access to all verified answers on virt.ldubgd.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome