Skip to content
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

Create Y-combinator function #191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Johnius
Copy link

@Johnius Johnius commented Jun 27, 2016

This function might have a good fit here to see if testee knows how to implement recursion without having it natively in a language. Yes, it's more theoretical question.

Correct answer is

{
  yCombinator: function (fn) {
    return function (n) {
      return fn(n, fn)
    }
  }
}

@Johnius
Copy link
Author

Johnius commented Jun 27, 2016

  150:14  error  Do not nest ternary expressions           no-nested-ternary
  150:14  error  Ternary operator used                     no-ternary
  150:26  error  Gratuitous parentheses around expression  no-extra-parens
  150:27  error  Ternary operator used                     no-ternary

Ok...

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.

1 participant