и посмотреть медиа
JavaScript test - knowledge check
и посмотреть медиа
Channel with tests to check JavaScript knowledge. Practical tasks for self-assessment of level.
Platform for testing JavaScript skills. Regularly publishes tasks of varying difficulty, helping identify knowledge gaps and prepare for real development tasks.
❗️Что будет на выходе? async function test() { console.log('1'); setTimeout(() => { console.log('2'); }, 0); await Promise.resolve(); console.log('3'); new Promise(resolve => { console.log('4'); resolve(); }).then(() => { console.log('5'); }); console.log('6'); } test(); console.log('7'); Ответ: 1 7 3 4 6 5 2 JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10; try { console.log(undeclaredVariable); } catch (e) { console.log('Error:', e.message); } } strictModeExample(); Ответ: Error: undeclaredVariable is nit defined JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❗️Что будет на выходе? async function test() { console.log('1'); setTimeout(() => { console.log('2'); }, 0); await Promise.resolve(); console.log('3'); new Promise(resolve => { console.log('4'); resolve(); }).then(() => { console.log('5'); }); console.log('6'); } test(); console.log('7'); Ответ: 1 7 3 4 6 5 2 JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❗️Что будет на выходе? const user = { profile: { name: 'Alice', settings: { notifications: { email: true, sms: false } } }, getPreference(type) { return this.profile?.settings?.notifications?.[type] ?? 'not configured'; } }; const admin = { profile: { name: 'Admin', settings: null }, getPreference: user.getPreference }; console.log(admin.getPreference('email')); Ответ: not configured JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❗️Что будет на выходе? function* range(start, end) { while (start < end) { yield start++; } } function* evens(iter) { for (const val of iter) { if (val % 2 === 0) yield val; } } function* take(n, iter) { let count = 0; for (const val of iter) { if (count++ >= n) return; yield val; } } function* pipeline() { yield* take(3, evens(range(1, 20))); yield* take(2, range(10, 15)); } const result = [...pipeline()]; console.log(result); Ответ: [2, 4, 6, 10, 11] JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❗️Что будет на выходе: const arr = [3, 8, 12]; const even = (elem) => elem % 2 === 0; console.log(arr.map(even)); Ответ: [ false, true, true ] JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❓Что будет на выходе? const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))); const pipe = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args))); const double = x => x * 2; const addTen = x => x + 10; const square = x => x * x; const negate = x => -x; const transform1 = compose(negate, square, addTen, double); const transform2 = pipe(double, addTen, square, negate); const val = 3; console.log(transform1(val), transform2(val)); Ответ: -256 -256 JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❓Что будет на выходе? const obj1 = { a: 1, b: 2 }; const obj2 = { b: 3, c: 4 }; const mergedObj = { ...obj1, ...obj2 }; console.log(mergedObj); Ответ: { a: 1, b: 3, c: 4 } JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиа❓Что будет на выходе? const curry = (fn) => { const arity = fn.length; return function curried(...args) { if (args.length >= arity) { return fn(...args); } return (...moreArgs) => curried(...args, ...moreArgs); }; }; const volume = (l, w, h) => l * w * h; const curriedVolume = curry(volume); const withLength5 = curriedVolume(5); const withLength5Width3 = withLength5(3); console.log(typeof withLength5); console.log(typeof withLength5Width3); console.log(withLength5Width3(4)); console.log(curriedVolume(2)(6)(7)); Ответ: function function 60 84 JavaScript test | #JavaScript & Max
Открыть канал и посмотреть медиаOnly registered users can share their opinion.
Be the first to share your impression of this resource!