Last active
April 24, 2023 23:41
-
-
Save quinnlas/1667fc91331dcc1fbf226b713961f0cb to your computer and use it in GitHub Desktop.
What does this function do?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fn = (n, a = [[], '']) => n in a ? !!a[n] : (a.push(...a), fn(n, a)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hint 1:
Formatted code:Hint 2:
Remember the difference between
in
andof
.Hint 3:
The function is meant to be called with 1 parameter, a number. Try some examples to see what the output is.