# Python to TypeScript Mini Map Quick syntax map for common constructs. ## Function typing ```py def fn(x: int) -> str: return str(x) ``` ```ts function fn(x: number): string { return String(x); } ``` ## Lambda / Arrow ```py lambda x: x + 1 ``` ```ts (x) => x + 1 ``` ## Fallback for missing values ```py value = x if x is not None else 'fallback' ``` ```ts const value = x ?? 'fallback'; ``` ## String interpolation ```py f"{year}-{month}-{day}" ``` ```ts `${year}-${month}-${day}` ``` ## Searching first match ```py next((p for p in parts if p['type'] == 'year'), None) ``` ```ts parts.find((p) => p.type === 'year') ```