Frontend
/ ** * Дан массив. Необходимо отсортировать нечетные по значению числа по возрастанию, * а четные оставить на своих местах * / export function oddSort(numbers) { // your code here } console.log(oddSort([2, 3, 7, 4, 6, 1, 5, 8, 9])); // [2, 1, 3, 4, 6, 5, 7, 8, 9] console.log(oddSort([2, 4, 6, 8])); // [2, 4, 6, 8] console.log(oddSort([3, 7, 1, 5, 9])); // [1, 3, 5, 7, 9] // Необходимо проверить решение задачи по двум сервисам, вызвав: // 1. checkResult(url1, solution) // 2. checkResult(url2, solution) // // checkResult: (url: string, solution: string | number) => Promise<boolean>; // // - Если оба запроса вернули true - вывести в console.log() success // - Если хоть один вернул false - вывести в console.log() fail // - Если хоть один не ответил - вывести в console.log() error // - Если хоть один отвечает дольше 1 сек - вывести в console.log() timeout import { checkResult } from '...'; export async function checkResults() { const solution = 'Any answer'; const url1 = 'yandex.ru'; const url2 = 'google.com'; checkResult(url1, solution); checkResult(url2, solution); }
Чем отличаются типы any и unknown в TypeScript?
Расскажите про lifecycle hooks во Vue 3. В каком порядке вызываются хуки у родительского и дочернего компонентов при монтировании страницы?
Как реализован принцип Dependency Inversion в Angular? Что такое InjectionToken?
Объясните принципы SOLID и их применение в Angular
/** * @param {Array} prev * @param {Array} next * @param {(item: any) => string} keyFn * @returns {{ added: Array, removed: Array }} */ export function diffGeneric(prev, next, keyFn) { // пишем код тут return { added: [], removed: [] }; } // prev = [1,2,3,4,6] // next = [2,3,4] // added = [] // removed = [1,6]
Как исправить проблему stale closure в useCallback без добавления зависимостей в dependency array?
Насколько часто работал с TypeScript, насколько глубоко его использовал?
Чем Promise.any отличается от Promise.race?
Что такое чистая функция? Является ли console.log внутри функции side-эффектом?
Что такое FunctionExpression и FunctionDeclaration? В чём их основное отличие?
Что такое Signal Store, для чего нужен?
Где в PHP лежит тело POST-запроса? Как получить данные из формы и из JSON-запроса?
Приходилось ли работать с Docker?
Как правильно делать HTTP-запросы в React? Чем Axios лучше fetch?
function cloneDeep(something: Cloneable): Cloneable { /* * TODO: implement deep clone without JSON.parse/stringify */ return JSON.parse(JSON.stringify(something)); } function assertDeep(a: Cloneable, b: Cloneable) { if (JSON.stringify(a) !== JSON.stringify(b)) { console.error("Not OK"); } console.log("OK"); } const obj: Cloneable = { a: 1, b: true, c: "hello", d: { there: "are", some: ["properties"] }, e: {}, f: [(), (), { key: { value: [1, 2, "3", "four"] } }], g: [] }; assertDeep(obj, cloneDeep(obj));
Что вернёт функция при числе 15 в вашей текущей реализации?
По каким критериям ты выделяла компоненты в UI-кит? Насколько комплексным и конфигурируемым он был?
Напиши функцию, которая принимает массив из чисел и строк и возвращает сумму всех элементов, конвертируя строки в числа. Как обработать строки, содержащие нечисловые символы?
In the graph, each circle represents an individual star. The position of the circle’s center indicates the star’s temperature in kelvins (K) and its luminosity (rate of energy emission) relative to that of the sun (Lsun). Note that higher temperatures are to the left. The size of the circle indicates the relative physical size of the star, and the labels indicate the types of stars shown. Apart from the main sequence stars, the group of stars with the greatest range of temperatures is the group of: - Red giants - Red supergiants - White dwarfs - Blue giants