Having fun with JavaScript. Functional style.