const old_sides = (box) => [box[0]*box[1], box[1]*box[2], box[2]*box[0]]; const sides = ([a, b, c], acc = []) => (acc.length == 3) ? acc : sides([b, c, a], acc.concat([a * b]));