Pigułka wiedzy
Masz 30 sekund? Super, tyle właśnie wystarczy, by nauczyć się czegoś nowego!
Destructure and Keep the Rest
You can combine destructuring and rest syntax to extract what you need and keep the rest.
const { id, ...info } = { id: 1, name: "Alice", role: "Admin" };
console.log(info); // { name: "Alice", role: "Admin" }
Skipping Array Elements with Destructuring
When using destructuring, you can skip the fields you’re not interested in — but you must keep the commas, e.g.:
const [ , second ] = ["Alice", "Olivia", "Ella"];
console.log(second); // "Olivia"
This allows you to “skip” array elements without creating extra variables.
Event propagation
Event propagation is the way events travel through the DOM tree. There are two directions of propagation:
Capturing phase (downward) – the event moves from the document
element down to the target element that triggered it.
Bubbling phase (upward) – the event moves from the target element back up the DOM tree until it reaches document
.
Falsy values
8 Falsy values that always evaluate to false:
false, null, undefined, "",
0, -0, 0n, NaN
Remember: empty array [] is truthy!
Powyższy zestaw ciekawostek z zakresu programowania to szybka porcja wiedzy w pigułce, dla zabieganych programistów, bez lania wody, bez zbędnej teorii – tylko czyste, skondensowane info w stylu „Czy wiesz, że …”
Dostrzeżesz tu zarówno podstawy, które każdy programista wiedzieć powinien, (przynajmniej w teorii, ale bądźmy szczerzy – pamięć mamy dobrą, ale krótką i bez google albo AI momentami byłoby ciężko), jak i programistyczne „smaczki”, przyprawiające o nerwowy śmiech nawet doświadczonych developerów. Niezależnie, czy jesteś początkującym koderem, doświadczonym devem, czy po prostu lubisz klikać w rzeczy, które wyglądają mądrze – znajdziesz tu coś dla siebie.
Przygotuj się na uśmiech, przebłyski myśli: „aaa, o to chodzi!” oraz stan „ooo, dobrze wiedzieć…”
UWAGA ! Możliwe efekty uboczne: nagłe oświecenie programistyczne oraz niepohamowana chęć dzielenia się wiedzą z każdym napotkanym developerem.