94 cards across 6 sections
arg = arg || fallback
with { type: 'json' }
const last = items.at(-1);const secondLast = items.at(-2);
config.timeout ??= 5000;user.roles ||= [];cache[key] &&= normalize(cache[key]);
const byStatus = Object.groupBy(orders, (o) => o.status);// { pending: [...], shipped: [...] }
Promise.try(() => maybeSyncOrAsync(input)) .then(handle) .catch(onError);
function readAll() { using file = openFile('data.txt'); return file.readAll();} // file.close() runs automatically
const rows = await Array.fromAsync(cursor);
const sorted = scores.toSorted((a, b) => a - b);const updated = list.with(2, 'replaced');
const cache = new Map();function get(key) { const ref = cache.get(key)?.deref(); return ref ?? compute(key);}
if (Object.hasOwn(record, 'id')) { // safe even if record = Object.create(null)}
const copy = structuredClone(originalState);
function* naturals() { let n = 1; while (true) yield n++; }const firstFive = naturals().map((n) => n * n).take(5);[...firstFive]; // [1, 4, 9, 16, 25]
const pattern = new RegExp(RegExp.escape(userQuery), 'i');
const b64 = new Uint8Array([72, 105]).toBase64();const bytes = Uint8Array.fromBase64(b64);
function safeHtml(strings, ...values) { return strings.reduce((out, s, i) => out + s + (values[i] ? escape(values[i]) : ''), '');}safeHtml`<p>${userInput}</p>`;
if (typeof globalThis.fetch === 'function') { // safe in browser, Node, and worker}