Javascript Array flatten(array)

Description

Javascript Array flatten(array)

Array.prototype.flatten = function(array) {
  return this.reduce((prev, next) => prev.concat(next), []);
};



PreviousNext

Related