typeofnan-javascript-quizzes icon indicating copy to clipboard operation
typeofnan-javascript-quizzes copied to clipboard

[Incorrect] answer to array method bind

Open acagastya opened this issue 5 years ago • 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:

  • [x] 123
  • [ ] abc
  • [ ] An error is thrown
  • [ ] Something else

acagastya avatar Oct 19 '19 16:10 acagastya

Updated in #99

acagastya avatar Oct 19 '19 16:10 acagastya

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.

nas5w avatar Oct 20 '19 19:10 nas5w

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.

acagastya avatar Oct 20 '19 19:10 acagastya

An alternative fix could be to rephrase the question:

"Which values are logged in the following scenario?"

hn3000 avatar Jan 21 '20 01:01 hn3000

Yet another alternative: remove the "Something else" option.

hn3000 avatar Jan 21 '20 10:01 hn3000

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.

acagastya avatar Jan 21 '20 12:01 acagastya

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 avatar Jan 21 '20 12:01 hn3000

@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 avatar Apr 28 '20 21:04 inomdzhon

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

acagastya avatar Apr 28 '20 21:04 acagastya

One more point... Each items separated by ,

image

inomdzhon avatar Apr 29 '20 19:04 inomdzhon