Learn when to use function expressions vs. function declarations in JavaScript, and how these methods for defining functions are different.
Tag: functional-js
Higher-order functions can take other functions as arguments or return a function as a result. Learn how to use them and why they're useful.
Dan Prince demonstrates ten ways you can use native ES6 features (such as arrow functions & collection methods) to replace Lodash in your projects.
Read Grab Our Free Printable Functional JavaScript Cheat Sheet and learn JavaScript with SitePoint. Our web development and design tutorials, courses, and books will teach you HTML, CSS, JavaScript, PHP, Python, and more.
Functional code is often touted as easier to test. M. David Green examines that claim and demonstrates how to get started testing functional JavaScript.
M. David Green uses filtering to limit a data set & chaining to combine the results with map/reduce. The result—clean code that performs complex operations.
With the aid of seven comprehensive demos, Mark Brown introduces you to Choo — a fun new framework for building single page apps in a functional manner.
M. David Green demonstrates how to implement function composition in JavaScript, a technique which lends itself to writing cleaner and more succinct code.
Using the Mori library, Dan Prince demonstrates how to create and work with immutable data structures, making your code simpler and easier to reason about.
M. David Green demonstrates how using the functional programming techniques of mapping & reducing can lead to cleaner code which is easy to read & maintain.
M. David Green demonstrates the concept of currying — a useful technique, to partially evaluate functions and make your functional JavaScript more readable.
M. David Green demonstrates the powerful, but dizzying concept of recursion by refactoring normal for and while loops to use functions that call themselves.