Here's a working example. (View the page source to see a more indepth example.)
fib() =
If you're used to languages with function definition pattern matching (ML, Haskell, Prolog, Erlang, etc.), you'll note that JavaScript doesn't include pattern matching. However, it does include flexible higher-order programming features that allow you to manipulate functions as objects... (more on that later)