[Incorrect] answer to array method bind
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Javascript call() & apply() vs bind()? - Stack Overflow
call and apply call a function while bind creates a function. Though with call() you pass arguments individually and apply() as an argument...
Read more >Function.prototype.bind() - JavaScript - MDN Web Docs - Mozilla
The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence...
Read more >Getting Out of Binding Situations in JavaScript - A List Apart
It takes two arguments: the binding object, and an array of the arguments to be passed to the function. Here's an example based...
Read more >JavaScript Function bind() Method - W3Schools
With the bind() method, an object can borrow a method from another object. The example below creates 2 objects ... The bind() method...
Read more >5. Working with Arrays and Loops - JavaScript Cookbook [Book]
Solution. Use the Array object slice method to create a new array based on elements within a given range: var ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.”