nas5w/typeofnan-javascript-quizzes

[Incorrect] answer to array method bind

Opened this issue ยท 10 comments

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:

  • 123
  • abc
  • An error is thrown
  • Something else

Updated in #99

nas5w commented

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 ๐Ÿ˜Œ

image

@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 ,

image