DEV Community

Discussion on: Daily Challenge #53 - Faro Shuffle

Collapse
 
kvharish profile image
K.V.Harish • Edited

My solution in JavaScript

const faroShuffle = (cards) => cards.slice(0, (cards.length / 2)).flatMap((card, index) => [card, cards[index + (cards.length / 2)]]);