Skip to content

exercise #2 #2

@nicc

Description

@nicc

Well done with reduce!! (high five)

The next exercise is simpler. It builds on the previous one.

Reduce provides the conceptual foundation for all recursive list computation. Your next few tasks will be to set about proving this. I've heard people say that anything can be computed with reduce. I think this is hyperbolic but still, it's a strong endorsement.

First up: implement myMap using only a single call to myReduce. Your whole function body can only be return myReduce(_______); It's all about the parameters you pass in.

Unfortunately I think you will need to use an array method. Just be sure that whatever you use is non-destructive. We're still not allowed to mutate state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions