const arr = [3, 1, 4, 1, 5];const sorted = [...arr].sort((a, b) => a - b);console.log(arr[0], sorted[0]);
const numbers = [10, 20, 30, 40, 50];const [first, second, ...rest] = numbers;console.log(rest.length);
.image { max-width: 100%; height: auto;}
const btn = document.querySelector('.btn');btn.addEventListener('click', function() { this.textContent = 'Clicked';});
for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 0);}
console.log(1 + "2" - 1);
div { width: 100px; padding: 20px; box-sizing: content-box;}/* Чему равна полная ширина элемента? */
console.log(1);setTimeout(() => console.log(2), 0);Promise.resolve().then(() => console.log(3));console.log(4);
let count = 0;const nums = [0, 1, 2, 3];nums.forEach(num => { if (num) count += 1;});console.log(count);
.parent { display: flex; height: 200px;}.child { height: 50%; flex-grow: 1;}/* Какая высота будет у .child? */