All academies

Practice

Function Playground

Every way to type a function, as live code. Pick a concept, read the note, then edit and run it.

A ? after a parameter name makes it optional. Inside the function its type includes undefined, so you must handle the missing case — the compiler enforces it.

No errors
Loading...

Console output appears here. Press Run or just type — the code compiles automatically.