Whats the easiest way (with \"native\" javascript) to duplicate every element in a javascript array?
The order matters.
For example:
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]); }, []);