Functional JavaScript examples