Ad
  • Custom User Avatar

    The guy really did his magic there.

  • Default User Avatar

    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.

  • Custom User Avatar

    If begin is greater than end, the function should return 0

    Isn't it better that in such case the function would return a sum of values got by subtracting the step from begin?

  • Custom User Avatar

    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;
    };

  • Custom User Avatar

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