It is not resolved. I am still getting the same error. Seems like tests are running in environment withou ''.repeat(). All you have to do is define it yourself:
String.prototype.repeat = function(n) {
var ret = this;
while(--n) ret += this;
return ret;
};
This solution is absolutely unreadable and I am really sad that things like this are possible in JavaScript. Where the brief olden times JavaScript syntax has gone...
The guy really did his magic there.
I used to think this kind of code was unreadable before too, but I have gotten used to it. I would however prefer better variable names.
Isn't it better that in such case the function would return a sum of values got by subtracting the step from begin?
It is not resolved. I am still getting the same error. Seems like tests are running in environment withou ''.repeat(). All you have to do is define it yourself:
String.prototype.repeat = function(n) {
var ret = this;
while(--n) ret += this;
return ret;
};
This solution is absolutely unreadable and I am really sad that things like this are possible in JavaScript. Where the brief olden times JavaScript syntax has gone...
(Marking as clever.)