Техническое собеседование
(async () => {
const p1 = new Promise((resolve) => {
setTimeout(() => resolve("1"), 0);
});
const p2 = new Promise((resolve) => {
resolve("2");
});
const all = async (promises) => {
};
// + Попросить написать тесты
// тесты
try {
const test1 = await all([p1, p2]);
console.log("test 1", test1.length === 2, test1);
} catch (e) {
console.log("Error1: ", e);
}
try {
const test2 = await await all([p2]);
console.log("test 2", test2.length === 1, test2);
} catch (e) {
console.log("Error2: ", e);
}
})();