Skip to content

Missing a map() function for collections #945

Closed
@sethladd

Description

@sethladd

Many libraries and collection libraries have a map() function, allowing the programmer to specify a function which is applied to each element of a collection, collects the return value of the function, and returns a new collection.

In Ruby:

a = [ "a", "b", "c", "d" ]
b = a.map {|x| x + "!" }
b #=> [ "a!", "b!", "c!", "d!" ]

Proposal, for Dart:

var a = ['a', 'b', 'c'];
var b = a.map((x) => x + "!");
b # => ['a!', 'b!', 'c!']

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions