.parent { display: flex; height: 200px;}.child { height: 50%; flex-grow: 1;}/* Какая высота будет у .child? */
const bird = { size: 'small'};const mouse = { name: 'Mickey', small: true};console.log(mouse[bird.size]);
const user = { name: "Alice" };Object.freeze(user);user.name = "Bob";console.log(user.name);
div { display: flex; justify-content: center;}/* Как будут выровнены элементы? */
const a = [1, 2, 3];const b = a.map(num => { if (num > 1) return num;});console.log(b);
async function getData() { return "Hello";}console.log(getData());
div { width: 100px; height: 100px; background: red; display: none;}/* Будет ли элемент занимать место на странице? */
const a = {};const b = { key: "b" };const c = { key: "c" };a[b] = 123;a[c] = 456;console.log(a[b]);
console.log(typeof null);console.log(typeof (() => {}));
.element { position: static; z-index: 999;}/* Будет ли элемент поверх остальных? */
const numbers = [1, 2, 3, 4];const res = numbers.reduce((acc, curr) => acc + curr);console.log(res);
const str = "Hello";str.test = 5;console.log(str.test);
/* font-size у html равен 16px */.container { font-size: 20px;}.text { font-size: 2rem;}/* Какой размер шрифта будет у .text? */
const arr = [1, 2, 3, 4, 5];arr.length = 2;console.log(arr);
const a = [1, 2];const b = a.reverse();b.push(3);console.log(a);
p { margin-bottom: 20px;}p + p { margin-top: 30px;}/* Какое расстояние будет между двумя соседними <p>? */
let name = "Alice";function show() { console.log(name); let name = "Bob";}show();
const numbers = [1, 2, 10, 21];numbers.sort();console.log(numbers);
.box { width: 100px; flex-basis: 200px;}/* Какая будет ширина элемента внутри flex-контейнера? */
function create() { let count = 0; const message = `Value: ${count}`; return function() { count++; console.log(message); };}const log = create();log();