1 2 3 4 5
function flatten() { return Array.prototype.reduce.call(arguments, function(p,e) { return p.concat(Array.isArray(e) ? flatten.apply(null,e) : e); },[]); }