0
Students
Here you need to build a lazy collection.
enumerable.js
Implement and export as default a class handling collections of objects. The main feature of this class is that it uses lazy processing.
import Enumerable from './enumerable.js';
const elements = [
{ key: 'value' },
{ key: '' },
];
const coll = Enumerable.wrap(elements);
const result = coll.where('key', 'value');
result.all() // [{ key: 'value' }]
Tips
- The usage examples are given in more detail in the tests
- Advanced challenge: add the
allWithMemoization()
method implementing memoization and test it by running themake test-memo
command in the exercise terminal <!-- * Ленивые коллекции -->
For full access to the challenge you need a professional subscription.
A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.