you're right, using Math.abs should make it a 1 liner
This comment is hidden because it contains spoiler information about the solution
Thanks a lot. And in the end it was v+1 is because the list begins with 1 instead of 0 right?
because the first step is ... % 1
... % 1
Could anyone explain why changing the 2nd line to v = 1 and leave everything else the same will yield the same result please?
v = 1
Is there a case for putting the arrow function in a variable over writing a 'normal' function? Is it more 'modern' to use arrow functions? I really like this solution.
why would you use let for constant values?
But why (how) does it work?
Recursive version - noice
Ahh that's what I was looking for!
Wow, I didn't know that you could have multiple ternary operators in the return statement. But that's a clever way you did!
Jesus this is too good compared to what I did , however I'm moving and learning , but where can I find and learn about such tricks, I didn't even know you can do this!