console.log([] == ![]);
const p1 = new Promise(res => setTimeout(() => res("A"), 100));const p2 = new Promise((_, rej) => setTimeout(() => rej("B"), 50));Promise.race([p1, p2]).then(console.log).catch(console.log);
.parent { transform: translateX(0);}.child { position: absolute; top: 10px;}/* Относительно чего позиционируется .child? */
const map = new Map();map.set('1', 'str');map.set(1, 'num');map.set(true, 'bool');console.log(map.size);
setTimeout(() => console.log('A'), 0);Promise.resolve().then(() => { console.log('B'); setTimeout(() => console.log('C'), 0);});console.log('D');
/* Какой цвет будет у НЕпосещенной ссылки при наведении курсора? */a:hover { color: red; }a:link { color: green; }
// Сколько раз выполнится цикл и что выведется в консоль?const obj = { [Symbol('id')]: 1, id: 2 };let count = 0;for (let key in obj) { count++;}console.log(count);
Promise.resolve(1) .then(x => x + 1) .then(x => { throw x }) .catch(x => x + 1) .then(x => console.log(x));
/* Какой цвет будет у текста в <div class="box">Text</div> ? */div { color: red; }.box:not(span) { color: green; }.box { color: blue; }