logo

Crowdly

Browser

Add to Chrome

Розробка сучасних вебзастосунків на платформі Node.js

Looking for Розробка сучасних вебзастосунків на платформі Node.js test answers and solutions? Browse our comprehensive collection of verified answers for Розробка сучасних вебзастосунків на платформі Node.js at learn.ztu.edu.ua.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Node.js

Що виведе цей код?

console.log('A');

setTimeout(() => console.log('B'), 0);

Promise.resolve().then(() => console.log('C'));

console.log('D');

100%
0%
0%
0%
0%
View this question

Node.js

Що виведе цей код?

const p1 = Promise.resolve('A');

const p2 = Promise.reject(new Error('fail'));

const p3 = Promise.resolve('C');

Promise.all([p1, p2, p3])

.then(r => console.log('ok', r))

.catch(e => console.log('err', e.message));

100%
0%
0%
0%
0%
View this question

Node.js

Що виведе цей код?

Promise.resolve(1)

.then(n => {

Promise.resolve(n + 10);

})

.then(v => console.log(v));

0%
0%
0%
0%
100%
View this question

Node.js

HTTP-сервер на Node.js має обробник, який виконує while (Date.now() - start < 3000) {}. Що станеться з іншими запитами, які надійдуть під час виконання цього обробника?

100%
0%
0%
0%
0%
View this question

Node.js

Який із наведених симптомів НЕ є типовою ознакою callback hell?

100%
0%
0%
0%
0%
View this question

Node.js

Цей код приховує баг. У якому випадку виконається рядок console.log(data.length)?

readFile('x.txt', (err, data) => {

if (err) {

console.error(err);

}

console.log(data.length);

});

0%
0%
0%
0%
100%
View this question

Node.js

Цей код не компілюється. Яка найменша зміна зробить його коректним без використання any?

function process(value: unknown): string {

return value.toUpperCase();

}

0%
0%
0%
0%
100%
View this question

Node.js

Кожний виклик функції fetchUser(id) займає 100 мс. Скільки орієнтовно виконуватиметься цей код?

const u1 = await fetchUser(1);

const u2 = await fetchUser(2);

const u3 = await fetchUser(3);

0%
100%
0%
0%
0%
View this question

Node.js

Чому код нижче втрачає паралелізм?

const users = await Promise.all([

await fetchUser(1),

await fetchUser(2),

await fetchUser(3),

]);

0%
0%
0%
0%
100%
View this question

Node.js

Що виведе цей код?

async function getUser() { return { name: 'Ivan' }; }

async function main() {

const u = getUser();

console.log(u.name);

}

main();

0%
0%
0%
100%
0%
View this question

Want instant access to all verified answers on learn.ztu.edu.ua?

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

Browser

Add to Chrome