Skip to content

High Order Functions never passes #128

@rhberro

Description

@rhberro

I wrote these lines of codes and it worked, but now when i try to do it again it fails!

Code

function repeat(operation, num) {
    if (!num) {
        return false;
    }
    operation();
    return repeat(operation, --num);
}

module.exports = repeat;

Results

functional-javascript verify high-order-functions.js 
------------------------
Called function 1 times.
Called function 2 times.
Called function 3 times.
Called function 4 times.
Called function 5 times.
Called function 6 times.
Called function 7 times.
Called function 8 times.
Called function 9 times.
------------------------
Called function 1 times.
Called function 2 times.
Called function 3 times.
Called function 4 times.
Called function 5 times.
Called function 6 times.
Called function 7 times.
Called function 8 times.
Called function 9 times.

# FAIL

Your solution to Higher Order Functions didn't pass. Try again!

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