Skip to content

v2.1.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 09 Jun 17:50
v2.1.0
f45380c
  • 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.