Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Well, that's the question of the goal you are writing code for. Speed may be the critical parameter in some applications, and may be absolutely not important in some others. The code readability and, consequently, supportability by other engineers may be critical in some other situations. Learning and practicing complex language features produce different code altogether.

    CodeWars has two ways to "support" a particular solution - "Best Practices" and "Clever", and you can choose which one is appropriate.

    Posting the solution that is best from your point of view is a good way of promoting your point of view.

    Posting claims that the existing solutions are bad in one way or another, is a good way to make yourself look weird. :)

  • Custom User Avatar

    I just tested it in Chrome 40, and map is now slightly faster than using a for loop.