const t = [1, 2, [3, 4, [5, 6]]];
function one(arr) { return arr.reduce((acc, val) => acc.concat(Array.isArray(val) ? one(val) : val), []); }; u = one(t); // [1, 2, 3, 4, 5, 6]