typeofnan-javascript-quizzes
typeofnan-javascript-quizzes copied to clipboard
[Incorrect] answer to array method bind
Describe the bug For the question Array Method Binding, an incorrect answer is set to correct answer.
Expected behavior The expected output is
1
2
3
And since it is not an option, the right answer should be Something else
.
Possible update: Change the question to:
const reduce = ['a', 'b', 'c'].reduce.bind([1, 2, 3]);
reduce((acc, cur) => acc + cur, '');
The options being:
- [x] 123
- [ ] abc
- [ ] An error is thrown
- [ ] Something else
Updated in #99
I'm not sure I agree with this. I don't really want to get into technicalities surrounding whether there are line breaks in the console output.
The only reason I got my answer wrong is that I was expecting it on new lines, and it was not in the option. If we are going for the subtle things, I think this should be considered.
An alternative fix could be to rephrase the question:
"Which values are logged in the following scenario?"
Yet another alternative: remove the "Something else" option.
In both the cases, @hn3000, it feels as the options are wrong. If it wasn't 'something else', I would have thought the options were wrong. Either the options should reflect the correct result, or the code snippet should be changed, imho.
True. Same happens in the Superman / Batman example. But I can also understand @nas5w when he says "I don't really want to get into technicalities surrounding whether there are line breaks in the console output."
@hn3000 hmmm, interesting, but here (see image) we have separator by space 🤔 And it isn't falsetrue
😅
And then why not "Batman" "Superman"
@nas5w? 😃
"BatmanSuperman"
incorrect 😞
PS: anyway, @nas5w thanks a lot for the quiz – it's gambling and refreshes the mind 😌
@inomdzhon Yeah, when there is a possibility of string formatting, and there is an option NOTA, that is different from this one. There is a scope of ambiguity in that one. Not in this one.
One more point...
Each items separated by ,