Oh, it's been a while since I've had bandwidth to participate. Today's was nice & relaxing, though. Just what I need before a flight.
const split = arr =>
[arr.slice(0, arr.length / 2), arr.slice(arr.length / 2)];
const interleave = (a, b) =>
a.reduce((shuffled, aIdx, idx) => (shuffled.push(aIdx, b[idx]), shuffled), );
const faro = arr => interleave(...split(arr));
Full version w/ tests at gist.github.com/kerrishotts/bde389...
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.