Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Higher Order Programming in JavaScript

By Sjoerd Visscher
2006-08-18


When should you use this?

Modularisation

When you have 2 (or several) functions that are almost the same except for a small part of the code, then you should consider to combine these functions into one. Replace the part that is different with a function call to a separate function. This function is passed to the new more general function as an argument.

Something different

When you've grown bored of writing for-loops (like I did), methods like reduce will be a welcome change in programming style. For me, higher order programming has made Javascript a lot more fun, and I hope you'll have fun with this too!



Tutorial Pages:
» Introduction
» Generating HTML
» Using methods as functions
» When should you use this?


This article is licensed under the Creative Commons


 | Bookmark
Related Tutorials:
» JavaScript Debugging Techniques with Firebug
» Striped Tables Using JavaScript
» Opening PDFs in a New Window with JavaScript
» Essential Javascript -- A Javascript Tutorial
» Submit Forms Conditionally using JavaScript
» How to Setup a Randomising Function

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources