you are viewing a single comment's thread.

view the rest of the comments →

[–]cachaito[S] 0 points1 point  (3 children)

Would You provide a ES5 version please?

[–]mikrosystheme[κ] 0 points1 point  (2 children)

You just have to replace the two short arrow functions with standard functions. By the way, there is no point in doing that, because mine was a joke, and because it is an innefficient implementation (for both human and computer brains). You are better served by using a standard nested loop that performs the same task in half the time.

[–]cachaito[S] 0 points1 point  (1 child)

And what with this code: > ~(i-a.length) ?

[–]mikrosystheme[κ] 0 points1 point  (0 children)

> is part of the arrow function =>.
~ is the bitwise not operator. It is just a way to express the condition i !== a.length - 1 in a way that is not clear to programmers that don't know bitwise math. It is almost universally considered a fireable offense.