const x = await fetch("/api");
if (x.ok) return x.json();
Code preview
const greet = (name) => { return `Hello, ${name}!`;};async function fetchData(url) { const res = await fetch(url); if (!res.ok) throw new Error(res.status); return res.json();}const items = data .filter(x => x.active) .map(x => x.name);
def fibonacci(n: int) -> list[int]: a, b = 0, 1 result = [] for _ in range(n): result.append(a) a, b = b, a + b return resultsquares = {x: x**2 for x in range(10)}print(fibonacci(10))
SELECT u.name, COUNT(o.id) AS order_count, SUM(o.total) AS total_spentFROM users uLEFT JOIN orders o ON o.user_id = u.idWHERE u.created_at > '2024-01-01' AND u.status = 'active'GROUP BY u.id, u.nameHAVING COUNT(o.id) > 5ORDER BY total_spent DESCLIMIT 20;