6 kyu
Walter's miraculous FizzBuzz factory
78 of 664bkaes
Loading description...
Arrays
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai). Refer to this and this
fixed
nice kata.
This comment has been hidden.
Not sure if I'm correctly understanding the idea. There are two examples in the instructions. In the first, myFizz; 3 returns fizz, 5 returns buzz and 15 returns fizzBuzz because it's divisible by both. In the second, myFooBar; 2 returns foo, 4 returns bar, 6 returns foobar. I would've expected 6 to return foo , 4 to return foobar and 8 to return foobar. What am I missing?
i was just thinking the same thing today
i'm not sure what to return when the array is empty? can't see anything about that in the description.
okay, I've got it now. Consider adding in the description that the function should return n as a string if the array is empty. I only knew this by looking at the test expected result
Hey, having a bit of a problem with the JavaScript version, the tests with strings (foo bar foobbar etc) are all passing but for the n values I keep getting something like:
didn't work for 4 - Expected: 4, instead got: 4
You must return a string not a number :)
D'Oh! Thanks very much, nice Kata
Approved :)
Translated; still not 100% sure the random test cases are the best (when I thought of doing this kata on my own, I have different ideas taking some coprimes together, but ok), but they are along the lines of your previous ones :)
approved
This comment has been hidden.
Kudos for you pointing out issues at yourself, but wouldn't all the cheating be prevented just by adding hidden random tests with a different array name?
This comment has been hidden.
This comment has been hidden.
Mh, right, though I am not sure if a user can work through it without knowing how many items are in the array, not to mention that, also in this case, if you are that good to cheat this way, then probably you don't need to cheat at all.
Do you want me to fix it in my translations or do you think they are ok like they are now?
This comment has been hidden.
Yup. Going to do that. Was going to use .cloneDeep, but this solution doesn't need additional resources. Thanks.
I have to take another look at the translations tomorrow.
It's the day after tomorrow now. Fixed
This comment has been hidden.
Changed in the tests. However, that's probably not enough, neither in the filled, nor in the complete random test.