Ad
  • Default User Avatar

    I don't know who you are, but let there be a divine cure upon you for creating this.

  • Default User Avatar

    This comment has been deleted.

  • Custom User Avatar

    actually map itself has nothing to do with the repeat - it just passes the element's index to the callback function. the repetition is provided by repeat() getting the index in this specific case.

  • Custom User Avatar

    I guess you learn something new everyday lol, I had no idea you could add an incrementor to map(). I guess it's because map() is an iterative method, there's a couple of examples of an index being used with map() on the mdn, but it isn't explicitly stated anywhere else to my knowledge.

  • Default User Avatar

    I came up with the same solution but I genuinely tried various approaches before this. I love mathematics because there is always an alternative pattern to recognize and you can tackle problems from various angles. I think I gave this about ~2 hours before I just realized what I need to do but I actually enjoyed this.

  • Default User Avatar

    I understand everything about this, except for why the "i" actually works as the repeat attribute? Why does this work? I understand everything about it except for that. I looked up various description about how the map function is supposed to work but I just don't get it. I used map before and it always did what I thought it would but in this case I'm just stumped.