N
N
Nazar Linovetsky2015-01-11 17:08:08
JavaScript
Nazar Linovetsky, 2015-01-11 17:08:08

Training tasks on the topic Recursion and Closures?

In search of practical tasks on the topics: Recursion and Closures (Javascript).
Offer tasks as close as possible to the practical application of these two techniques in real Javascript development.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-01-11
Protko @Fesor

Organize a chain of method calls using currying (similar to, for example, lodash/underscrore).
In general, for closures, any task with collection traversal through map / reduce, for example, implement map through reduce or filter through reduce.
Separately, for closures - hiding the implementation of some service - only interface functions are exported from the module,
recursion is usually a traversal of graphs and collections, the classic task of implementing a binary search or some kind of sorting is not much in demand in practice ... Of course, you can propose to implement the function validation of some object with links...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question