Skip to content

Conversation

@romanV7
Copy link

It says that Function array is not found.


constseq=f=>g=>x=>0;
constseq=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
constarray=newA();
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 freeto 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

@romanV7@tshemsedinov