.map((_,i) : "i" will be the index of the current element, we don't need to work with the value here

We return a value located inside the input, at the following index:

If we are in an odd space, the targeted index will be i/2 + true * (a.length / 2 + 0.5). Thanks to coercion, "true" will be translated to 1, hence we will fetch the (a.length / 2 + 0.5)+i/2th index

Else if we are in an even space, the target will be i/2 + false * (a.length / 2 + 0.5), translated to i/2 + 0 * (a.length / 2 + 0.5) (hence, i/2)

Taking into account that the input is an array, you could save some bytes by replacing [...a] with just a (for golf purposes).

Apart from that, the solution seems really specific to the problem, and doesn't work for different arrays. For example:

f(['ace','two','three','four','five','six','seven','eight'])//["ace", "four", "two", "five", "three", "six", "four", "seven"]// there are 2 "four" and no "eight"

## re: Daily Challenge #53 - Faro Shuffle VIEW POST

FULL DISCUSSIONA bit of golf:

It works like this:

`.map((_,i)`

: "i" will be the index of the current element, we don't need to work with the value here`i/2 + true * (a.length / 2 + 0.5)`

. Thanks to coercion, "true" will be translated to`1`

, hence we will fetch the`(a.length / 2 + 0.5)+i/2`

th index`i/2 + false * (a.length / 2 + 0.5)`

, translated to`i/2 + 0 * (a.length / 2 + 0.5)`

(hence,`i/2`

)The return will then be the following:

Taking into account that the input is an array, you could save some bytes by replacing

`[...a]`

with just`a`

(for golf purposes).Apart from that, the solution seems really specific to the problem, and doesn't work for different arrays. For example:

Thanks a lot for the input! The problem was in the

`2.5`

usage, which had to be replaced with`a.length/2-.5`

. I updated my answer!You can shorten the index computation to: