Functional Programming Examples in JavaScript