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? */
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 (() => {}));