I came up with something similar to tymeJV’s answer
[2, 3, 1, 4].reduce(function (res, current, index, array) {
return res.concat([current, current]);
}, []);
I came up with something similar to tymeJV’s answer
[2, 3, 1, 4].reduce(function (res, current, index, array) {
return res.concat([current, current]);
}, []);