6 kyu
Power .bind()
3,474kesheshyan
Description:
You probably know about Function.prototype.bind
method in JavaScript. It returns a copy of the original function but this function will always be called in the specified context. The problem is that you can't rebind another context any more.
var func = function () {
return this.prop;
};
var obj1 = {prop: 1},
obj2 = {prop: 2};
func = func.bind(obj1);
func(); // Will produce 1
func = func.bind(obj2);
func(); // Will also produce 1 :(
Your task is override the native Function.prototype.bind
method by a new one that will allow you to rebind context multiple times. In this kata you don't need to worry about currying, testing function will never get params.
Fundamentals
Similar Kata:
Stats:
Created | May 30, 2014 |
Published | May 30, 2014 |
Warriors Trained | 5642 |
Total Skips | 404 |
Total Code Submissions | 48881 |
Total Times Completed | 3474 |
JavaScript Completions | 3474 |
Total Stars | 73 |
% of votes with a positive feedback rating | 73% of 152 |
Total "Very Satisfied" Votes | 100 |
Total "Somewhat Satisfied" Votes | 23 |
Total "Not Satisfied" Votes | 29 |