Skip to content

I complited all tasks, but second one failed (it says that Function array is not found), but it`s ok. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

romanV7
Copy link

@romanV7 romanV7 commented Jan 3, 2020

It says that Function array is not found.

@@ -1,5 +1,6 @@
'use strict';

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