Skip to content

Conversation

romanV7
Copy link

@romanV7 romanV7 commented Jan 3, 2020

It says that Function array is not found.


const seq = f => g => x => 0;
const seq = f => g =>
(typeof(g) === 'number' ? f(g) : seq(a => f(g(a))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single-line function will be better

}
}
// array is function
const array = new A();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to create function with name array, not instance of class. The purpose of this task is using closure for holding data instead of class fields.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run npm t before commit, one test fails.

@tshemsedinov
Copy link
Member

See function usage here: https://github.com/HowProgrammingWorks/Closure/blob/master/Exercises.ru.md
And think about it's contract: array <function> and it returns <function>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants