Skip to content

Releases: Conaclos/cow-list

v2.1.0

09 Jun 17:50
v2.1.0
f45380c
Compare
Choose a tag to compare
  • Allow to create a list from an iterable

    You can now build a list from any iterable object.
    In the following example we use a generator to create a list of three
    random numbers:

    function* rand() {
        while (true) {
            yield Math.random()
        }
    }
    
    const l = CowList.fromIterable(rand(), 3)
    const ml = MutList.fromIterable(rand(), 3)

    Note that you must provide the number of items to pick from the
    iterable object in the second parameter.