Skip to content
Akin C edited this page Apr 15, 2018 · 8 revisions

Welcome to the Javascript-an-own-high-order-function- wiki!

This repository is part of a larger project!

◀️ PREVIOUS PROJECT| NEXT PROJECT ▶️


Higher-order functions in Javascript have their benefits and these are:

1. Bugfixing gets easier, because of the distributed logic (e.g. focusing on callback functions to find the ERROR!).

2. Optimizing efficiency is also easier to handle, because of the distributed logic.

3. The abstract code style makes it easier to read.

Even though Javascript offers a lot of intern Higher-order functions, it could be useful to write an own one.

In order to recognize when it is reasonable to write one, the developer should look for common patterns in his/her code. As an example, lets asume there are three functions which all in itself concatenate values from an array. And depending on the type of the values they are differently handled. In this case the common pattern is the concatenating feature. And the "differently handled" part could be the callback functions.

Content

The user interaction part should look like the content as seen below by starting "index.html" in a web browser.

ERROR: No image found!

In the picture above there are three valuers which evaluate the value of the user Input as follows:

  • "Valuer 1" values all numbers and trashes rest.
  • "Valuer 2" values all upper case characters and trashes rest.
  • "Valuer 3" values all vowels and trashes rest.

The colored areas are just for a better readability in the wiki and are not part of the content. To use the project just download the files and execute "index.html". Note that all files should be placed in the same folder so that the functionality of the code is guaranteed.

Clone this wiki locally